Updates to sending and message sequences
This commit is contained in:
@@ -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 -
|
||||
|
||||
Reference in New Issue
Block a user