Private
Public Access
1
0

Updates to sending and message sequences

This commit is contained in:
James Magahern
2018-11-20 19:57:35 -07:00
parent ddec4be8d6
commit 4f5cd058c5
17 changed files with 264 additions and 45 deletions

View File

@@ -106,12 +106,12 @@ static NSString *const MBIMBridgeToken = @"net.buzzert.kordophone";
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_chatRegistryDidLoad:) name:IMChatRegistryDidLoadNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_chatItemsDidChange:) name:IMChatItemsDidChangeNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserverForName: IMChatRegistryUnreadCountChangedNotification
object: nil
queue: [NSOperationQueue mainQueue]
usingBlock:^(NSNotification *note) {
NSLog(@"Unread count changed: %d", (int)[[IMChatRegistry sharedInstance] unreadCount]);
}];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_unreadCountChanged:) name:IMChatRegistryUnreadCountChangedNotification object:nil];
}
- (void)_unreadCountChanged:(NSNotification *)notification
{
// Not a lot of useful information plumbed here...
}
- (void)_messageReceived:(NSNotification *)notification
@@ -124,7 +124,7 @@ static NSString *const MBIMBridgeToken = @"net.buzzert.kordophone";
if (![message isFromMe]) {
MBIMUpdateItem *updateItem = [[MBIMUpdateItem alloc] init];
updateItem.changedChat = chat;
updateItem.message = message;
updateItem.addedMessage = message;
[[MBIMUpdateQueue sharedInstance] enqueueUpdateItem:updateItem];
} else {
@@ -140,7 +140,14 @@ static NSString *const MBIMBridgeToken = @"net.buzzert.kordophone";
- (void)_chatItemsDidChange:(NSNotification *)notification
{
NSLog(@"chat items changed: %@", notification);
IMChat *chat = [notification object];
if (chat) {
NSLog(@"Chat items change for GUID: %@", [chat guid]);
MBIMUpdateItem *updateItem = [[MBIMUpdateItem alloc] init];
updateItem.changedChat = chat;
[[MBIMUpdateQueue sharedInstance] enqueueUpdateItem:updateItem];
}
}
#pragma mark -