summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_chanhistory.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp
index 4bd230a7c..25110b495 100644
--- a/src/modules/m_chanhistory.cpp
+++ b/src/modules/m_chanhistory.cpp
@@ -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<Channel>();
- 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<Channel>());
+ 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