diff options
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 15 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 14 |
2 files changed, 27 insertions, 2 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index f02606d18..0ea713d00 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -523,10 +523,23 @@ class ModuleSSLGnuTLS : public Module log(DEBUG, "m_ssl_gnutls.so: Handshake completed"); // This will do for setting the ssl flag...it could be done earlier if it's needed. But this seems neater. - Srv->FindDescriptor(session->fd)->Extend("ssl", "ON"); + userrec* extendme = Srv->FindDescriptor(session->fd); + extendme->Extend("ssl", "ON"); + + // Tell whatever protocol module we're using that we need to inform other servers of this metadata NOW. + std::deque<std::string>* metadata = new std::deque<std::string>; + metadata->push_back(extendme->nick); + metadata->push_back("ssl"); + metadata->push_back("ON"); + Event* event = new Event((char*)metadata,(Module*)this,"send_metadata"); + event->Send(); + delete event; + delete metadata; + // Change the seesion state session->status = ISSL_HANDSHAKEN; + // Finish writing, if any left MakePollWrite(session); return true; diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 747bcd7b7..da617c871 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -3251,6 +3251,18 @@ class ModuleSpanningTree : public Module } } + virtual void OnEvent(Event* event) + { + if (event->GetEventID() == "send_metadata") + { + std::deque<std::string>* params = (std::deque<std::string>*)event->GetData(); + if (params->size() < 3) + return; + (*params)[2] = ":" + (*params)[2]; + DoOneToMany(Srv->GetServerName(),"METADATA ",*params); + } + } + virtual ~ModuleSpanningTree() { } @@ -3268,7 +3280,7 @@ class ModuleSpanningTree : public Module List[I_OnUserQuit] = List[I_OnUserPostNick] = List[I_OnUserKick] = List[I_OnRemoteKill] = List[I_OnRehash] = 1; List[I_OnOper] = List[I_OnAddGLine] = List[I_OnAddZLine] = List[I_OnAddQLine] = List[I_OnAddELine] = 1; List[I_OnDelGLine] = List[I_OnDelZLine] = List[I_OnDelQLine] = List[I_OnDelELine] = List[I_ProtoSendMode] = List[I_OnMode] = 1; - List[I_OnStats] = List[I_ProtoSendMetaData] = 1; + List[I_OnStats] = List[I_ProtoSendMetaData] = List[I_OnEvent] = 1; } /* It is IMPORTANT that m_spanningtree is the last module in the chain |