WhisperSystems/Signal-iOS — pull request #142 by Strilanc (2014-09-07 02:21:47+00:00)
Title: Registration consternation 2

Comes after https://github.com/WhisperSystems/Signal-iOS/pull/141 .

Will need to be rebased to include FREEBIE.

Needs to be checked over carefully, as I can't test these code paths without an iphone. Also some of the changes might be wrong (I've commented those points).

- Renamed `registerForPushWithToken`/`verifyPushActivated` so that they matched `AppDelegate` events that trigger them
- Moved logging of registration failure into `PushManager`
- Renamed and inverted `encounteredRevokedPushPermission` into `haveReceivedPushNotification`
- Renamed the `retry:upToNTimes:...` to `attempt:upToNTimes:...`
- Added a variant of `attempt:upToNTimes:...` without a timeout
- Refactored `askForPushRegistrationWithSuccess:...` into a `askForPushRegistration` that returns a future
- Retrying of push registration is now managed by a utility method
- Refactored `registerPushToken:success:...` to return a future
- Various negligible improvements and style adjustments
- "Fixed" warnings in third party speex code by turning the warnings off for that sub-project