From 58f0749fa3dd9869797ffcd49511a75340660a16 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sun, 9 Nov 2003 02:52:43 +0000 Subject: [PATCH] - Fixed desynch bug regarding extended channelmodes. Reported by AngryWolf (#0001347) --- Changes | 1 + src/channel.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index bb3f072aa..61b71cf33 100644 --- a/Changes +++ b/Changes @@ -2562,3 +2562,4 @@ seen. gmtime warning still there - Added hostname check for me::name since this could cause mysterious trouble. - Removed references to tkline/tzline from help.conf. Reported by penna22 (#0001340) - Fix for permanent modules w/ config hooks (they were not called). +- Fixed desynch bug regarding extended channelmodes. Reported by AngryWolf (#0001347) diff --git a/src/channel.c b/src/channel.c index 7aee3a9c4..647e3ce36 100644 --- a/src/channel.c +++ b/src/channel.c @@ -6080,22 +6080,24 @@ CMD_FUNC(m_sjoin) { int r; char *parax; - r = Channelmode_Table[i].sjoin_check(chptr, extcmode_get_struct(oldmode.extmodeparam,Channelmode_Table[i].flag), extcmode_get_struct(chptr->mode.extmodeparam, Channelmode_Table[i].flag)); + CmodeParam *ourm = extcmode_get_struct(oldmode.extmodeparam,Channelmode_Table[i].flag); + CmodeParam *theirm = extcmode_get_struct(chptr->mode.extmodeparam, Channelmode_Table[i].flag); + + r = Channelmode_Table[i].sjoin_check(chptr, ourm, theirm); switch (r) { case EXSJ_WEWON: { - CmodeParam *p = extcmode_get_struct(oldmode.extmodeparam, Channelmode_Table[i].flag); CmodeParam *r; - parax = Channelmode_Table[i].get_param(p); + parax = Channelmode_Table[i].get_param(ourm); Debug((DEBUG_DEBUG, "sjoin: we won: '%s'", parax)); - r = Channelmode_Table[i].put_param(p, parax); - if (r != p) + r = Channelmode_Table[i].put_param(theirm, parax); + if (r != theirm) /* confusing eh ;) */ AddListItem(r, chptr->mode.extmodeparam); break; } case EXSJ_THEYWON: - parax = Channelmode_Table[i].get_param(extcmode_get_struct(chptr->mode.extmodeparam,Channelmode_Table[i].flag)); + parax = Channelmode_Table[i].get_param(theirm); Debug((DEBUG_DEBUG, "sjoin: they won: '%s'", parax)); Addit(Channelmode_Table[i].flag, parax); break;