Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
[client] don’t ignore a notification if it’s a hide notification
Browse files Browse the repository at this point in the history
I think this should fix it getting stuck…
  • Loading branch information
kirb committed Jun 19, 2017
1 parent e228e88 commit a5ed73b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions client/HBTSStatusBarAlertController.x
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,19 @@
#pragma mark - Notification

- (void)_receivedStatusNotification:(NSNotification *)notification {
// grab all the data
NSString *iconName = notification.userInfo[kHBTSMessageIconNameKey];
NSString *content = notification.userInfo[kHBTSMessageContentKey];
BOOL direction = ((NSNumber *)notification.userInfo[kHBTSMessageDirectionKey]).boolValue;
NSTimeInterval timeout = ((NSNumber *)notification.userInfo[kHBTSMessageTimeoutKey]).doubleValue;

// when apps are paused in the background, notifications get queued up and delivered when they
// resume. to work around this, we determine if it’s been longer than the specified duration; if
// so, disregard the alert
if ([[NSDate date] timeIntervalSinceDate:notification.userInfo[kHBTSMessageSendDateKey]] > timeout) {
if (direction && [[NSDate date] timeIntervalSinceDate:notification.userInfo[kHBTSMessageSendDateKey]] > timeout) {
return;
}

// grab all the data
NSString *iconName = notification.userInfo[kHBTSMessageIconNameKey];
NSString *content = notification.userInfo[kHBTSMessageContentKey];
BOOL direction = ((NSNumber *)notification.userInfo[kHBTSMessageDirectionKey]).boolValue;

// deserialize the bold range array to NSRange
NSArray <NSNumber *> *boldRangeArray = notification.userInfo[kHBTSMessageBoldRangeKey];
NSRange boldRange = NSMakeRange(boldRangeArray[0].unsignedIntegerValue, boldRangeArray[1].unsignedIntegerValue);
Expand Down

0 comments on commit a5ed73b

Please sign in to comment.