diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/notifymanager.cpp | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/src/notifymanager.cpp b/src/notifymanager.cpp index aed5dd9f8..af7720911 100644 --- a/src/notifymanager.cpp +++ b/src/notifymanager.cpp @@ -83,11 +83,9 @@ namespace NotifyManager void notify(const unsigned int message) { - if (message >= NotifyTypes::TYPE_END || - localChatTab == nullptr) - { + if (message >= NotifyTypes::TYPE_END) return; - } + const NotificationInfo &info = notifications[message]; if (*info.text == 0) { @@ -98,10 +96,7 @@ namespace NotifyManager switch (info.flags) { case NotifyFlags::EMPTY: - localChatTab->chatLog(gettext(info.text), - ChatMsgType::BY_SERVER, - IgnoreRecord_false, - TryRemoveColors_true); + chatLog(localChatTab, gettext(info.text)); break; case NotifyFlags::GUILD: @@ -139,31 +134,22 @@ namespace NotifyManager void notify(const unsigned int message, const int num) { - if (message >= NotifyTypes::TYPE_END || - localChatTab == nullptr) - { + if (message >= NotifyTypes::TYPE_END) return; - } + const NotificationInfo &info = notifications[message]; if (info.flags == NotifyFlags::INT && *info.text != 0) { - localChatTab->chatLog( - strprintf(gettext(info.text), num), - ChatMsgType::BY_SERVER, - IgnoreRecord_false, - TryRemoveColors_true); + chatLog(localChatTab, strprintf(gettext(info.text), num)); } soundManager.playSfx(SoundDB::getSound(message), 0, 0); } void notify(const unsigned int message, const std::string &str) { - if (message >= NotifyTypes::TYPE_END || - localChatTab == nullptr) - { + if (message >= NotifyTypes::TYPE_END) return; - } soundManager.playSfx(SoundDB::getSound(message), 0, 0); @@ -182,14 +168,9 @@ namespace NotifyManager switch (info.flags) { case NotifyFlags::STRING: - { - localChatTab->chatLog( - strprintf(gettext(info.text), str.c_str()), - ChatMsgType::BY_SERVER, - IgnoreRecord_false, - TryRemoveColors_true); + chatLog(localChatTab, + strprintf(gettext(info.text), str.c_str())); break; - } case NotifyFlags::GUILD_STRING: { ChatTab *const tab = getGuildTab(); |