Merge branch 'charlesmchen/groupNameUpdates'

pull/1/head
Matthew Chen 8 years ago
commit e7639bbdbe

@ -15,7 +15,7 @@ typedef enum : NSUInteger {
kCallMissed = 3,
kCallOutgoingIncomplete = 4,
kCallIncomingIncomplete = 5,
kGroupUpdateJoin = 6,
// kGroupUpdateJoin has been deprecated.
kGroupUpdateLeft = 7,
kGroupUpdate = 8,
} CallStatus;

@ -180,7 +180,11 @@
if (adapter.infoMessageType == TSInfoMessageTypeGroupQuit ||
adapter.infoMessageType == TSInfoMessageTypeGroupUpdate) {
// repurposing call display for info message stuff for group updates, ! adapter will know because the date
// is nil
// is nil.
//
// TODO: I suspect that we'll want a separate model
// that conforms to <OWSMessageData> for info
// messages.
CallStatus status = 0;
if (adapter.infoMessageType == TSInfoMessageTypeGroupQuit) {
status = kGroupUpdateLeft;

@ -2079,8 +2079,15 @@ typedef enum : NSUInteger {
return _editingDatabaseConnection;
}
- (void)yapDatabaseModified:(NSNotification *)notification {
// Currently, we update thread and message state every time
// the database is modified. That doesn't seem optimal, but
// in practice it's efficient enough.
// We need to `beginLongLivedReadTransaction` before we update our
// models in order to jump to the most recent commit.
NSArray *notifications = [self.uiDatabaseConnection beginLongLivedReadTransaction];
[self updateBackButtonAsync];
if (isGroupConversation) {
@ -2091,10 +2098,9 @@ typedef enum : NSUInteger {
self.thread = [TSGroupThread threadWithGroupModel:gThread.groupModel transaction:transaction];
}
}];
[self setNavigationTitle];
}
NSArray *notifications = [self.uiDatabaseConnection beginLongLivedReadTransaction];
if (![[self.uiDatabaseConnection ext:TSMessageDatabaseViewExtensionName]
hasChangesForNotifications:notifications]) {
[self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {

Loading…
Cancel
Save