- 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();