From c8f92d97c2cd92a07bbb76b96a67cd089c7e3407 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 11 Jun 2014 14:15:40 +0200 Subject: m_spanningtree Assign an id to new Memberships --- src/modules/m_spanningtree/main.cpp | 7 ++++++- src/modules/m_spanningtree/main.h | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/modules') 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; -- cgit v1.2.3