summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-02-22 13:19:36 +0000
committerSadie Powell <sadie@witchery.services>2024-02-22 13:19:36 +0000
commitf93d9e76983e15bd1642c31d6acf430754f0600a (patch)
tree97e99a42ca08f6d798adbdf397e1cf3671037676 /src
parent7423fa9998d7e7082cac63eda18ae785091ea1b0 (diff)
Store the source message identifier in CommandSource.
Diffstat (limited to 'src')
-rw-r--r--src/bots.cpp7
-rw-r--r--src/command.cpp9
2 files changed, 13 insertions, 3 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index f468ff59f..7417db6e7 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -228,7 +228,12 @@ void BotInfo::OnMessage(User *u, const Anope::string &message, const Anope::map<
if (this->commands.empty())
return;
- CommandSource source(u->nick, u, u->Account(), u, this);
+ Anope::string msgid;
+ auto iter = tags.find("msgid");
+ if (iter != tags.end())
+ msgid = iter->second;
+
+ CommandSource source(u->nick, u, u->Account(), u, this, msgid);
Command::Run(source, message);
}
diff --git a/src/command.cpp b/src/command.cpp
index 7925e8bbd..2ac6cb7d7 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -17,8 +17,13 @@
#include "regchannel.h"
#include "channels.h"
-CommandSource::CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *r, BotInfo *bi) : nick(n), u(user), nc(core), reply(r),
- c(NULL), service(bi)
+CommandSource::CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *r, BotInfo *bi, const Anope::string &m)
+ : nick(n)
+ , u(user)
+ , nc(core)
+ , reply(r)
+ , service(bi)
+ , msgid(m)
{
}