diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.h | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 99f54cce8..6fa494809 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -37,7 +37,9 @@ ModuleSpanningTree::ModuleSpanningTree() : rconnect(this), rsquit(this), map(this) - , commands(NULL), DNS(this, "DNS") + , commands(NULL) + , currmembid(0) + , DNS(this, "DNS") { } @@ -509,6 +511,9 @@ void ModuleSpanningTree::OnUserJoin(Membership* memb, bool sync, bool created_by if (!IS_LOCAL(memb->user)) return; + // Assign the current membership id to the new Membership and increase it + memb->id = currmembid++; + if (created_by_local) { CmdBuilder params("FJOIN"); diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 513e86a2f..7fb2c6701 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -63,6 +63,10 @@ class ModuleSpanningTree : public Module */ SpanningTreeCommands* commands; + /** Next membership id assigned when a local user joins a channel + */ + Membership::Id currmembid; + public: dynamic_reference<DNS::Manager> DNS; |