Commit Graph

594 Commits

Author SHA1 Message Date
Michael Kirk 933281f234 format objc.
This is part of unforking JSQMVC, but I'm only reformatting files
otherwise changed rather than reformatting the entire project for git
sanity.

This is intentionally a second commit so we can separate formatting
changes from code changes

* brace should drop after method definition (this is common across
  almost all objc projects, and allows you to quickly differentiate
  multi-line method signatures from their implementation.
* aligning consecutive assignments ongoingly muddies git history

// FREEBIE
2016-07-14 23:15:06 -07:00
Michael Kirk 4d320d6015 Unfork JSQMessagesViewController
Geting back on upstream fixes a couple bugs (see ##Bugfixes), and also
will make future updates easier.

The unforking process was basically this:

* move custom message types (Calls and DisplayedMessages) classes from our
  custom JSQMVC fork into Signal-iOS.
* Move any method customization into our subclass. Including
  ColletionView stuff, bubble sizing, and gesture behavior

Bug Fixes
---------
* Fix mis-sized incoming media bubbles.

Bubble size was being cached by interaction id. Which broke when
receiving an attachment. The problem is that incoming media messages
were initially the height of a "Downloading Attachment" info message.
Instead we use the mediaHash for media messages to expire the bubble
size when the media changes.

* fix missized bubble when MVC did appear

The MessagesViewController isn't sized correctly until ViewWillAppear.
This caused the first round of bubbles to be rendered incorrectly (they
assumed a larger container than they had).  I think is reflected in the
current version of the app by a reflow occurring shortly after the view
appears.

Chores
------
* bump travis to build with xcode8
* specify RQV development team for device build. required by xcode 8 beta

Cleanup
------
* Refactor messageing XIB so that elements are hangning outside of
  the views frame
* Fix compiler warning with explicit cast
* delete deprecated lineBreakmode, it's the default value anyway.

// FREEBIE
2016-07-14 23:15:05 -07:00
Michael Kirk 987ce5f832 bump release target to 2.3.6.0 (#1256)
// FREEBIE
2016-07-13 16:59:20 -07:00
Michael Kirk d24d54d4f2 small IOS9 Fixes (#1253)
* Fix compiler warnings by explicitly casting to int.
* Show a better permissions message when viewing attachments.
* Fix comment.

// FREEBIE
2016-07-08 16:39:28 -07:00
Michael Kirk 992dbe586a Fix crash on unknown attachment (#1249)
// FREEBIE
2016-07-07 17:13:51 -07:00
Michael Kirk cc47a6df7e Merge pull request #1248 from WhisperSystems/release-target-2.3.5
bump release target to 2.3.5.0
2016-07-07 16:29:53 -07:00
Michael Kirk 01b00e3814 bump release target to 2.3.5.0
// FREEBIE
2016-07-07 15:17:31 -07:00
Michael Kirk 385126027b Merge pull request #1247 from WhisperSystems/ios10-crash-on-attaching-media
Ios10 crash on attaching media
2016-07-07 15:14:59 -07:00
Michael Kirk 1f1920b648 Fix crash on iOS10 when attaching media
New permissions strings are required.

// FREEBIE
2016-07-07 12:17:53 -07:00
Michael Kirk d4f2c0f249 ensure picker source available to prevent crash
This is crashing on simulator, but presumable if it weren't available
for other reasons (permissions?) it would also crash.

// FREEBIE
2016-07-07 10:31:51 -07:00
Michael Kirk 1e43e139fd Get back on upstream SocketRocket (#1241)
* Latest SocketRocket includes
  * crash fixes.
  * our new security policy management, so we don't have to
    keep rebasing to incorporate updates.

* Adapt to policy renaming in SignalServiceKit
* bump XCode version to play nice with SWIFT_NAME

// FREEBIE
2016-06-30 23:08:49 -07:00
Michael Kirk 2fed645c0e Merge pull request #1239 from WhisperSystems/update-translations
updated french and japanese translations
2016-06-28 22:19:18 -07:00
Michael Kirk b83bcdab8a updated french and japanese translations 2016-06-28 15:36:34 -07:00
Michael Kirk e3d94db17c Merge pull request #1238 from WhisperSystems/missing-call-button
Fix: No Call icon for registered Signal contact
2016-06-28 15:35:20 -07:00
Michael Kirk a181d218cf extract and test contact searcher
// FREEBIE
2016-06-28 14:13:39 -07:00
Michael Kirk 8c6bf3cba6 prefer properties per style
// FREEBIE
2016-06-28 08:58:29 -07:00
Michael Kirk 1f31015d54 find phone number regardless of punctuation used in search.
e.g. 3235551234, 323-555-1234, 1-323-555-1234, etc. are all the same as +13235551234.

// FREEBIE
2016-06-28 08:58:29 -07:00
Michael Kirk 26f5418500 Remove distinction between TS and RP users
* Ensure we're always showing call button for non-group threads.
* search phone strings directly rather than precomputing field

// FREEBIE
2016-06-28 08:58:29 -07:00
Michael Kirk 62633ff7f4 remove unused code
// FREEBIE

dot notation is only for property access

// FREEBIE

remove unused code
2016-06-28 08:58:29 -07:00
Michael Kirk 1e0f0157c1 namespace ContactsManager -> OWSContactsManager
rename test class ContactManager->OWSContact_s_Manager
update docs

// FREEBIE
2016-06-28 08:58:29 -07:00
Michael Kirk b3bb4c745e Set explicit height for all media types. Audio is the only special case. (#1237)
This might FIX #1111, but I think there are actually a handful of things
breaking our layout.

// FREEBIE
2016-06-28 06:50:12 -07:00
Michael Kirk 87d2fe1131 bump release target to 2.3.4
// FREEBIE
2016-06-27 20:56:09 -07:00
Michael Kirk a2862757ab crash reporting instructions in issue template (#1235)
// FREEBIE
2016-06-27 16:14:14 -07:00
Michael Kirk aa9908d439 Large media attachments should be compressed (#1232)
* compress non-GIF media as JPEG

There are some problems with this approach
- Potentially re-encoding files
- Lots of code in the controller

* Compress GIF > 5MB into static JPEG.

This isn't ideal, but a stopgap to prevent people from sending huge
GIFs, while also giving them *some* kind of feedback (e.g. a static jpeg
is sent rather than their being no indication to sender+recipient that
anything was attempted.)

* spell bmp correctly

// FREEBIE
2016-06-23 13:43:31 -07:00
Michael Kirk 76352bf471 Code Cleanup (#1229)
* remove unused Signal-Bridging-Header
* move Adapters out of ViewControllers directory
* remove unimplemented method from header
* Fix unused variable warning.
* Move SignalsViewControllers out of UITests directory.
* remove executable bit from source files

// FREEBIE
2016-06-17 15:41:41 -07:00
Michael Kirk 7c84c4569a Only call UI modifying observers when UI is present (#1226)
* centralize observers relevant to a "visible UI"
* collocate init/teardown of observers

// FREEBIE
2016-06-17 10:45:48 -07:00
Michael Kirk bee7c71dff Prevent freeze when swiping back twice. (#1224)
FIXES #1222

Maybe this code was a vestige of a former way we were customizing the
back button. In any case, it's no longer required for swipe-to-pop
functionality.

// FREEBIE
2016-06-16 16:42:01 -07:00
Michael Kirk 4a1c53f624 Access contacts atomically to avoid corruption (PR #1223)
4% of our crashes are from accessing latestContactsById with an invalid
address. This was partially addressed by assigning a value on init, but
it's still happening.

By converting the ivar to an atomic property we can avoid any funny
business that would happen when accessing this var while it's being
updated in a different thread.

Also, make sure we're copying to defensively strip mutability.

Also:
* bumped release target
* removed unused code
* dealloc at the top per style.
2016-06-16 13:54:33 -07:00
Michael Kirk 8f04f863b7 hide UI element must happen on main thread (#1220)
// FREEBIE
2016-06-15 13:39:13 -07:00
Michael Kirk 7fef6aeab2 Fix crash after deleting message (#1219)
* update to JSQMessageViewController fixes #1218
* no need for SVC to retain membership of MVC

// FREEBIE
2016-06-15 12:46:29 -07:00
Michael Kirk 965261f465 attempt to fix intermittent SEGFAULT in SocketRocket (Maybe Fixes #1196) (#1217)
* Rebased OWS fork of SocketRocket against upstream
* Pulling in SocketRocket directly from OWS Github rather than going
  through the motions of publishing a pod that only we use.
* Bump version

// FREEBIE
2016-06-14 14:19:28 -07:00
Michael Kirk e7f3092f00 CocoaPods 1.0 update and Travis-CI compatibility (#1216)
* CocoaPods 1.0 compatibility. Thanks to @brianherman and @orta for the Podfile changes, taken from PR #1156
* Modified Travis-CI to use the newer CocoaPods 1.0 as well.
* Performance improvements to Travis-CI to reduce build time by 50%-75%

Cherry-picked and conflicts resolved by @michaelkirk
2016-06-14 11:58:56 -07:00
Michael Kirk 78a5355b04 Initialize latestContacts to empty dict (#1207)
Seeing intermittent segfaults on [latestContacts allKeys].
This could be because latestContacts is initialized async.

//FREEBIE
2016-06-09 12:06:10 -07:00
Michael Kirk 2565801c39 Fix new localizations (#1206)
* bump version
* pulled latest translations
* Register localizations with app.

- Persian (fa)
- Indonesian (id)
- Macedonian (Macedonia) (mk)
- Shona (sn)
- Galacian (gl)

(Project > Signal > Localizations > Add Localizations)

Generalized Macedonian locale since it seems like iOS doesn't support
the "Macedonia(Macedonia)" sub-locale

* disable farsi until proper RTL interface work is done

// FREEBIE
2016-06-09 11:04:51 -07:00
2-4601 50d0cd6089 Improve debug log hint in issue template (#1204)
// FREEBIE
2016-06-02 09:36:06 -07:00
Michael Kirk a736e8de66 Fixes avatar not showing for single contact thread (#1202)
* requires update to SignalServiceKit
* updated Pod Dependencies
* bumped version

Fixes #1201

// FREEBIE
2016-05-26 15:49:34 -05:00
Michael Kirk 83de0d75b8 New translations (#1193)
* modify script to fetch all uploaded translations.

Otherwise we don't always get the latest translations.
This might be because we're only fetching "reviewed" translations, but
so-far-so-good with unreviewed translations, and we don't have a real
"reviewing" hierachy in place anyway. This policy might change in the
future, but at least now it's not ambiguous.

// FREEBIE

* latest translations
2016-05-24 08:14:00 -07:00
Michael Kirk d7c48578a9 Fix invite crashing without sms (#1192)
* Fixes "New Message" --> "Invite contact" exception for iPhone devices that do not support SMS messaging

* fix SMS invite on empty inbox

This code appears in two contexts - (1) in an empty inbox , where no other view
controller is presented, and (2) in compose interface where a
search controller is presented, and must first be dismissed.

* only check SMS sending ability directly, (not device model)

This is better because:
1. sometimes iPhones can't send SMS
2. Sometimes iPads/iPods can send SMS

* correct localization key

* bump build

// FREEBIE
2016-05-23 11:39:30 -07:00
Michael Kirk 9bacc3de78 Reset compose view on thread switch (#1187)
* all Signal users can send text messages, never hide texting toolbar.

//FREEBIE

* Fix composition box size when switching threads.

Partial revert of 2c83046ff6 which
introduced a shared reusable message view controller across threads.

2c83046ff6 resulted in several discovered
bugs so far (#1179, #1150, #1152, and maybe: #1146). It's pretty clear
at this point we're going against the grain of how
JSQMesageViewController is intended to be used, and since the nominal
purpose of this feature (iPad Layout) doesn't exist, we should revert to
the known good way of interacting with the MessageViewController,
creating a fresh instance per thread.

// FREEBIE
2016-05-17 09:38:49 -07:00
Michael Kirk da6597118a Fix unable to send invite via sms (#1188)
* bump release

//FREEBIE

* fix invite over sms alert

Could not present the sms invite alert controller because we were
already presenting the UISearchController

FIXES: #1182

// FREEBIE
2016-05-16 15:52:11 -07:00
Michael Kirk 4537324fe5 Mark encryption as exempt, per Moxie's instruction. (#1173)
Bump release number

// FREEBIE
2016-05-09 13:52:05 -07:00
Michael Kirk 496f8117f9 Update translations (#1172)
* Update translations (4 new translations!)

*New Translations*

- Persian (fa) (100%)
- Indonesian (id) (82%)
- Macedonian (Macedonia) (mk_MK) 100%
- Shona (sn) 98%

Inluded a script to pull translations that are >=80% complete

80% is completely arbitrary, but nicely bisects the current translation
efforts which fall into buckets of "over 80%" and "under 50%."

// FREEBIE

* final tx pull before push source

//FREEBIE

* tx pull, after updating source (plus some eager beavers already pushed new translations)

iStringVerify passes

* Make "add person" label more i18n flexible

This accommodates (e.g.) Italian, which was being truncated.

// FREEBIE

* Galician localization

Moitas grazas xesusmosquera!

// FREEBIE

* i18n for Unarchive action

started leaving hints for our translators. These are currently manually
redundantly duplicated in the source/strings file, in hopes of a more
automated future with genstrings.

// FREEBIE

* include iStringsVerify check in update-translations script

and pull latest translations after including UNARCHIVE action
// FREEBIE

* i18n GROUP_MEMBERS_HEADER

//FREEBIE

* pull translations
2016-05-08 17:17:37 -07:00
Michael Kirk 7f022404d1 [UI] smaller group action menu icon, revert edit divider to neutral color (#1169)
* Group actions bar button image was too big

Added image inset to resize.

// FREEBIE

* return blue line to neutral gray. (partial revert of 0c1a97a743)

// FREEBIE

* Podfile.lock corollary to updating SSL in b7813bdc9a

// FREEBIE
2016-05-07 09:29:10 -07:00
Frederic Jacobs b7813bdc9a OpenSSL dependency update. (#1167)
Following security advisory
(https://www.openssl.org/news/secadv/20160503.txt), OpenSSL removed
sources of previous version.

//FREEBIE
2016-05-03 23:07:27 +02:00
Michael Kirk 5286c032ce reset "Load Earlier Messages" when switching threads (#1163)
Since we're now re-using the message controller across threads, we have
to reset some elements to their initial state when switching threads.
Missed this one.

Fixes: #1150

// FREEBIE
2016-04-26 18:57:55 -07:00
Ronny f05429b594 Prevent skewed group image (fixes #756) (#1159)
* Prevent skewed group image (#756)

- fixes #756

//FREEBIE

* Prevent skewed group image in inbox view (#756)

- fix skewed inbox view image
- fixes #756

//FREEBIE
2016-04-22 12:34:09 -07:00
Michael Kirk 752b0fecab Bloom filter migration: check for file before deleting (#1147)
- Extracted migration method
- added some logging

// FREEBIE
2016-04-18 11:17:08 -07:00
Michael Kirk 9f572881f8 * Cache cleaning uses YAP notificationsThis way we don't have to worry about cleaning the cache explicitlywhen we do destructive actions.// FREEBIE
* Cache cleaning uses YAP notifications

This way we don't have to worry about cleaning the cache explicitly
when we do destructive actions.

// FREEBIE
2016-04-18 10:07:35 -07:00
Michael Kirk 95ab3d677c must *always* be in main thread when dismissing view controller. (#1114)
Fixes intermittent crash when uploading new group photos.

// FREEBIE
2016-04-13 15:26:50 -07:00
Michael Kirk 5869fb8e06 Fix ability to attach photos from camera (#1112)
* Fix ability to attach photos from camera

Looks like this came about with the animated GIF handling. We'll only
go down the byte-comparison-mime-type-detecting code path for attaching
existing photos, since it only exists for animated GIFs.

This will also revert to properly compressing our image attachments, so
long as they are taken from the camera.

* Prevent crash when tapping broken image

It never makes sense to present a "full screen" nil image. Previously
this happened when camera-capture was broken, but could conceivably
happen for other as-of-yet unknown reasons.

// FREEBIE
2016-04-13 11:38:42 -07:00