diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-11 14:15:40 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-11 14:15:40 +0200 |
commit | c8f92d97c2cd92a07bbb76b96a67cd089c7e3407 (patch) | |
tree | 251053b46d8443040ff69040913aea591b9bea81 /src/modules | |
parent | 84e358da3c97ee61fc1374e5551ad789e1258aa6 (diff) |
m_spanningtree Assign an id to new Memberships
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; |