Skip to content

Commit

Permalink
Auto-inititate OTR when contact comes online
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisballinger committed Jul 12, 2016
1 parent fb8b900 commit 3c9ab79
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,13 @@ - (void)updateViewWithKey:(NSString *)key colleciton:(NSString *)collection
}

// Update Buddy Status
BOOL previousState = self.state.isThreadOnline;
self.state.isThreadOnline = buddy.status != OTRThreadStatusOffline;

// Auto-inititate OTR when contact comes online
if (!previousState && self.state.isThreadOnline) {
[[OTRProtocolManager sharedInstance].encryptionManager maybeRefreshOTRSessionForBuddyKey:key collection:collection];
}
[self didUpdateState];

//Update Buddy knock status
Expand Down

0 comments on commit 3c9ab79

Please sign in to comment.