summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/modules.h13
-rw-r--r--src/modules.cpp1
-rw-r--r--src/modules/m_spanningtree.cpp2
3 files changed, 14 insertions, 2 deletions
diff --git a/include/modules.h b/include/modules.h
index c61658e1b..7b4cb4585 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -289,7 +289,7 @@ enum Implementation { I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUse
I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange,
I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnOperCompre, I_OnGlobalOper, I_OnGlobalConnect, I_OnAddBan, I_OnDelBan,
I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister,
- I_OnOperCompare, I_OnChannelDelete, I_OnPostOper };
+ I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData };
/** Base class for all InspIRCd modules
* This class is the base class for InspIRCd modules. All modules must inherit from this class,
@@ -676,6 +676,17 @@ class Module : public classbase
*/
virtual void OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, std::string extname);
+ /* Allows modules to syncronize metadata not related to users or channels, over the network during a netburst.
+ * Whenever the linking module wants to send out data, but doesnt know what the data
+ * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then
+ * this method is called. You should use the ProtoSendMetaData function after you've
+ * correctly decided how the data should be represented, to send the metadata on its way if
+ * if it belongs to your module.
+ * @param proto A pointer to the module handling network protocol
+ * @param opaque An opaque pointer set by the protocol module, should not be modified!
+ */
+ virtual void OnSyncOtherMetaData(Module* proto, void* opaque);
+
/** Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module.
* Please see src/modules/m_swhois.cpp for a working example of how to use this method call.
* @param target_type The type of item to decode data for, TYPE_USER or TYPE_CHANNEL
diff --git a/src/modules.cpp b/src/modules.cpp
index f6152ccf6..c7b7fadc1 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -282,6 +282,7 @@ void Module::OnSyncChannel(chanrec* chan, Module* proto, void* opaque) { };
void Module::ProtoSendMode(void* opaque, int target_type, void* target, std::string modeline) { };
void Module::OnSyncChannelMetaData(chanrec* chan, Module* proto,void* opaque, std::string extname) { };
void Module::OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, std::string extname) { };
+void Module::OnSyncOtherMetaData(Module* proto, void* opaque) { };
void Module::OnDecodeMetaData(int target_type, void* target, std::string extname, std::string extdata) { };
void Module::ProtoSendMetaData(void* opaque, int target_type, void* target, std::string extname, std::string extdata) { };
void Module::OnWallops(userrec* user, std::string text) { };
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index caaaa775a..747bcd7b7 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1245,7 +1245,7 @@ class TreeSocket : public InspSocket
/* Send everything else (channel modes, xlines etc) */
this->SendChannelModes(s);
this->SendXLines(s);
- FOREACH_MOD(I_OnSyncOtherMetaData,OnSyncOtherMetaData((Module*)TreeProtocolModule,(void*)this,list[j]));
+ FOREACH_MOD(I_OnSyncOtherMetaData,OnSyncOtherMetaData((Module*)TreeProtocolModule,(void*)this));
this->WriteLine("ENDBURST");
Srv->SendOpers("*** Finished bursting to \2"+s->GetName()+"\2.");
}