psychs / limechat

IRC Client for Mac
http://limechat.net/mac/
1.56k stars 264 forks source link

Duplicate channelID #278

Open keith-rollin opened 8 years ago

keith-rollin commented 8 years ago

I have the following server/channel configuration:

serverA
* channelA1
* channelA2
serverB
* channelB1
* channelB2

Both serverA and serverB require a password. As well, channelB1 and channelB2 require passwords.

What I noticed was that only one of channelB1 or channelB2 would automatically be joined when I started up LimeChat. Checking the "Channel Properties" dialog box, I would see that the channel that was not joined had an incorrect password (according to the number of •'s in the password field). Entering the correct password, I could then join the channel, but the problem would recur the next time I started LimeChat.

I checked the passwords in the keychain and noticed that only three of the four passwords had been saved. The passwords for serverA, serverB, and one of channelB1 or channelB2 were there, but the password for the other channel was not.

Checking LimeChat's plist file, I noticed that both channelB1 and channelB2 had the same channelID. Because of this duplication, both channels were trying to save their passwords to the same keychain entry.

I'm not sure how both channels got the same UUID. I poked around the source code a little, and found that a field called _channelID was initialized with:

        _clientID = [NSString lcf_uuidString];

or

        _clientID = [dic stringForKey:@"clientID"] ?: [NSString lcf_uuidString];

lcf_uuidString seems to return a new UUID each time, so I'm not sure how a duplicate occurred.

At any rate, I edited the plist so that one of the UUIDs was different. After starting up and entering the password associated with the UUID, all seems to be working now.