[X2serv-general] Fix to m_join
Brought to you by:
sirvulcan
|
From: John Z. <jo...@as...> - 2002-02-22 00:07:52
|
There is a problem with the way X2 handles joins. When X2 receives the join
string from the server it processes it in reverse, which is flawed since it
is possible to be joined to #test, and then /join 0,#test which would cause
X2 to think you were joined to #test twice, before reading the 0.
I have written a quick and simple fix for a problem with m_join() in X2.
int m_join(M_PARAMS)
{
char chan[100], *channels;
int i = 0, j = 0;
channels = strtok(rest, " ");
if(!channels) {
Debug(DBGWARNING, "Invalid JOIN syntax (null channel).");
return(0);
}
while(1) {
if(channels[j] == '0') {
if(j == 0 || channels[j-1] == ',') {
RemoveNickFromAllChannels(uptr);
}
}
if(channels[j] == ',' || channels[j] == '\0') {
chan[i] = '\0';
ProcessJoin(GetChannel(chan), uptr, chan, 'J');
i = 0;
if(channels[j] == '\0') return(1);
}
else {
chan[i] = channels[j];
i++;
}
j++;
}
}
|