Update conversation view title when group name changes.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent ec06cf76e4
commit 081956c2b4

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

@ -180,7 +180,9 @@
if (adapter.infoMessageType == TSInfoMessageTypeGroupQuit || if (adapter.infoMessageType == TSInfoMessageTypeGroupQuit ||
adapter.infoMessageType == TSInfoMessageTypeGroupUpdate) { adapter.infoMessageType == TSInfoMessageTypeGroupUpdate) {
// repurposing call display for info message stuff for group updates, ! adapter will know because the date // repurposing call display for info message stuff for group updates, ! adapter will know because the date
// is nil // is nil.
//
// TODO: This doesn't seem like a good idea.
CallStatus status = 0; CallStatus status = 0;
if (adapter.infoMessageType == TSInfoMessageTypeGroupQuit) { if (adapter.infoMessageType == TSInfoMessageTypeGroupQuit) {
status = kGroupUpdateLeft; status = kGroupUpdateLeft;

@ -2079,8 +2079,18 @@ typedef enum : NSUInteger {
return _editingDatabaseConnection; return _editingDatabaseConnection;
} }
- (void)yapDatabaseModified:(NSNotification *)notification { - (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.
//
//
dispatch_async(dispatch_get_main_queue(), ^{
[self updateContents];
});
}
- (void)updateContents {
[self updateBackButtonAsync]; [self updateBackButtonAsync];
if (isGroupConversation) { if (isGroupConversation) {
@ -2091,6 +2101,7 @@ typedef enum : NSUInteger {
self.thread = [TSGroupThread threadWithGroupModel:gThread.groupModel transaction:transaction]; self.thread = [TSGroupThread threadWithGroupModel:gThread.groupModel transaction:transaction];
} }
}]; }];
[self setNavigationTitle];
} }
NSArray *notifications = [self.uiDatabaseConnection beginLongLivedReadTransaction]; NSArray *notifications = [self.uiDatabaseConnection beginLongLivedReadTransaction];

Loading…
Cancel
Save