summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-21 23:32:01 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-21 23:32:01 +0000
commit783f1640b6a5e9ffeae9a7d8c96bec9c412d4a91 (patch)
tree86c49cfb70b92745047f83c80e9b2f3f38e0792d /src/modules/m_spanningtree.cpp
parent06fd57cc35c9d5869ca3a24d349b791963b2acc4 (diff)
Fix spurious deops on channel creation, pointed out by jilles, noted by a number of people. :P
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5784 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index a8665350c..a1bed4fcc 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1591,6 +1591,7 @@ class TreeSocket : public InspSocket
userrec* who = NULL; /* User we are currently checking */
std::string channel = params[0]; /* Channel name, as a string */
time_t TS = atoi(params[1].c_str()); /* Timestamp given to us for remote side */
+ bool created = false;
/* Try and find the channel */
chanrec* chan = this->Instance->FindChan(channel);
@@ -1606,6 +1607,8 @@ class TreeSocket : public InspSocket
/* Does this channel exist? if it does, get its REAL timestamp */
if (chan)
ourTS = chan->age;
+ else
+ created = true; /* don't perform deops, and set TS to correct time after processing. */
/* In 1.1, if they have the newer channel, we immediately clear
* all status modes from our users. We then accept their modes.
@@ -1617,18 +1620,19 @@ class TreeSocket : public InspSocket
{
std::deque<std::string> param_list;
- if (chan)
- chan->age = TS;
-
/* Lower the TS here */
if (Utils->AnnounceTSChange && chan)
chan->WriteChannelWithServ(Instance->Config->ServerName,
"NOTICE %s :TS for %s changed from %lu to %lu", chan->name, chan->name, ourTS, TS);
ourTS = TS;
-
param_list.push_back(channel);
- /* Zap all the privilage modes on our side */
- this->RemoveStatus(Instance->Config->ServerName, param_list);
+
+ /* Zap all the privilage modes on our side, if the channel exists here */
+ if (!created)
+ {
+ this->RemoveStatus(Instance->Config->ServerName, param_list);
+ chan->age = TS;
+ }
}
/* Put the final parameter of the FJOIN into a tokenstream ready to split it */
@@ -1801,6 +1805,12 @@ class TreeSocket : public InspSocket
free(mode_users[f]);
}
+ /* if we newly created the channel, set it's TS properly. */
+ if (created)
+ {
+ chan->age = TS;
+ }
+
/* All done. That wasnt so bad was it, you can wipe
* the sweat from your forehead now. :-)
*/