]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_spanningtree Assign an id to new Memberships
authorAttila Molnar <attilamolnar@hush.com>
Wed, 11 Jun 2014 12:15:40 +0000 (14:15 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Wed, 11 Jun 2014 12:15:40 +0000 (14:15 +0200)
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/main.h

index 99f54cce84cffeaaf10e857becb8409dc81e2e25..6fa4948096e96835044f6bc9bb7d48b8ed8ac1e2 100644 (file)
@@ -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");
index 513e86a2f2b97967a5f4cc9657b61ad3a0083c71..7fb2c67012d79e67e81945650c964225653feac7 100644 (file)
@@ -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;