diff --git a/quassel-for-ios/quassel-for-ios/QuasselCoreConnection.h b/quassel-for-ios/quassel-for-ios/QuasselCoreConnection.h index fe4fc4d..bce2d0a 100644 --- a/quassel-for-ios/quassel-for-ios/QuasselCoreConnection.h +++ b/quassel-for-ios/quassel-for-ios/QuasselCoreConnection.h @@ -35,6 +35,7 @@ @property (nonatomic, strong) NSMutableArray *neworkIdList; @property (nonatomic, strong) NSMutableDictionary *networkIdNetworkNameMap; +@property (nonatomic, strong) NSMutableDictionary *networkIdMyNickMap; @property (nonatomic, strong) NSMutableDictionary *bufferIdBufferInfoMap; @property (nonatomic, strong) NSMutableDictionary *networkIdBufferIdListMap; @property (nonatomic, strong) NSMutableDictionary *networkIdServerBufferInfoMap; diff --git a/quassel-for-ios/quassel-for-ios/QuasselCoreConnection.m b/quassel-for-ios/quassel-for-ios/QuasselCoreConnection.m index 8feb5bb..0766938 100644 --- a/quassel-for-ios/quassel-for-ios/QuasselCoreConnection.m +++ b/quassel-for-ios/quassel-for-ios/QuasselCoreConnection.m @@ -34,6 +34,7 @@ @implementation QuasselCoreConnection @synthesize networkIdBufferIdListMap; @synthesize neworkIdList; @synthesize networkIdNetworkNameMap; +@synthesize networkIdMyNickMap; @synthesize bufferIdMessageListMap; @synthesize delegate; @synthesize networkIdServerBufferInfoMap; @@ -85,6 +86,7 @@ - (void) reConnect { bufferIdBufferActivityMap = nil; networkIdNetworkNameMap = nil; + networkIdMyNickMap = nil; networkIdUserMapMap = nil;; networkInitsReceived = 0; @@ -214,6 +216,10 @@ - (void) handleReceivedNetworkInit:(NSArray*)networkInit [networkIdNetworkNameMap setObject:networkName forKey:networkId]; [delegate quasselNetworkNameUpdated:networkId]; + NSString *myNick = [[initDict objectForKey:@"myNick"] string]; + [networkIdMyNickMap setObject:myNick forKey:networkId]; + NSLog(@"myNick %@", myNick); // might be empty when disconnected + NSDictionary *ircUsersAndChannels = [[initDict objectForKey:@"IrcUsersAndChannels"] dict]; NSDictionary *channels = [[ircUsersAndChannels objectForKey:@"channels"] dict]; @@ -419,6 +425,7 @@ - (void) handleReceivedVariant:(QVariant*)v //NSLog(@"networkIds = %@", networkIds); neworkIdList = [[NSMutableArray alloc] initWithCapacity:networkIds.list.count]; networkIdNetworkNameMap = [NSMutableDictionary dictionaryWithCapacity:networkIds.list.count]; + networkIdMyNickMap = [NSMutableDictionary dictionaryWithCapacity:networkIds.list.count]; networkIdUserMapMap = [NSMutableDictionary dictionaryWithCapacity:neworkIdList.count]; networkIdChannelMapMap = [NSMutableDictionary dictionaryWithCapacity:neworkIdList.count]; [networkIds.list enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { @@ -898,6 +905,8 @@ - (void) handleReceivedVariant:(QVariant*)v [usersForNetwork removeObjectForKey:oldNick]; ircUser.nick = newNick; [usersForNetwork setValue:ircUser forKey:newNick]; + + // FIXME If it is our nick, should update networkIdMyNickMap too } else { NSLog(@"FIXME unknown __objectRenamed__ %@", class); }