X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanhistory.cpp;h=38ec217dff7abcda16825c75d0f80f079fd440ce;hb=7cfeb971666b3a6709fe61bd01478697e6433f50;hp=4bd230a7c649c1278717696dcb84feb4efc6d7df;hpb=5a19ff00aca5d979bf9ca45a2b0d6e85acdc9fc3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp index 4bd230a7c..38ec217df 100644 --- a/src/modules/m_chanhistory.cpp +++ b/src/modules/m_chanhistory.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018 linuxdaemon - * Copyright (C) 2013, 2017-2020 Sadie Powell + * Copyright (C) 2013, 2017-2021 Sadie Powell * Copyright (C) 2013 Daniel Vassdal * Copyright (C) 2012-2015, 2018 Attila Molnar * Copyright (C) 2012, 2019 Robby @@ -221,18 +221,20 @@ class ModuleChanHistory void OnUserPostMessage(User* user, const MessageTarget& target, const MessageDetails& details) CXX11_OVERRIDE { + if (target.type != MessageTarget::TYPE_CHANNEL || target.status) + return; + std::string ctcpname; - if ((target.type == MessageTarget::TYPE_CHANNEL) && (target.status == 0) && (!details.IsCTCP(ctcpname) || irc::equals(ctcpname, "ACTION"))) - { - Channel* c = target.Get(); - HistoryList* list = historymode.ext.get(c); - if (list) - { - list->lines.push_back(HistoryItem(user, details)); - if (list->lines.size() > list->maxlen) - list->lines.pop_front(); - } - } + if (details.IsCTCP(ctcpname) && !irc::equals(ctcpname, "ACTION")) + return; + + HistoryList* list = historymode.ext.get(target.Get()); + if (!list) + return; + + list->lines.push_back(HistoryItem(user, details)); + if (list->lines.size() > list->maxlen) + list->lines.pop_front(); } void OnPostJoin(Membership* memb) CXX11_OVERRIDE