Index: dcpp/AdcHub.cpp =================================================================== --- dcpp/AdcHub.cpp (revision 1003) +++ dcpp/AdcHub.cpp (working copy) @@ -136,8 +136,8 @@ if(!c.getParam("NI", 0, nick)) { nick = "[nick unknown]"; } - fire(ClientListener::StatusMessage(), this, u->getIdentity().getNick() + " (" + u->getIdentity().getSIDString() + - ") has same CID {" + cid + "} as " + nick + " (" + AdcCommand::fromSID(c.getFrom()) + "), ignoring."); + fire(ClientListener::StatusMessage(), this, str(F_("%1% (%2%) has same CID {%3%} as %4% (%5%), ignoring") + % u->getIdentity().getNick() % u->getIdentity().getSIDString() % cid % nick % AdcCommand::fromSID(c.getFrom()))); return; } } else { @@ -203,13 +203,13 @@ } if(!baseOk) { - fire(ClientListener::StatusMessage(), this, "Failed to negotiate base protocol"); // @todo internationalize + fire(ClientListener::StatusMessage(), this, _("Failed to negotiate base protocol")); socket->disconnect(false); return; } else if(!tigrOk) { oldPassword = true; // Some hubs fake BASE support without TIGR support =/ - fire(ClientListener::StatusMessage(), this, "Hub probably uses an old version of ADC, please encourage the owner to upgrade"); + fire(ClientListener::StatusMessage(), this, _("Hub probably uses an old version of ADC, please encourage the owner to upgrade")); } } @@ -267,7 +267,7 @@ string tmp; if(c.getParam("MS", 1, tmp)) { - fire(ClientListener::StatusMessage(), this, tmp); + fire(ClientListener::StatusMessage(), this, tmp, ClientListener::FLAG_IS_SPAM); } if(s == sid) { Index: dcpp/ClientListener.h =================================================================== --- dcpp/ClientListener.h (revision 1003) +++ dcpp/ClientListener.h (working copy) @@ -29,6 +29,11 @@ typedef X<17> SearchFlood; typedef X<18> NmdcSearch; typedef X<19> AdcSearch; + + enum StatusFlags { + FLAG_NORMAL = 0x00, + FLAG_IS_SPAM = 0x01 + } virtual void on(Connecting, Client*) throw() { } virtual void on(Connected, Client*) throw() { } @@ -40,7 +45,7 @@ virtual void on(GetPassword, Client*) throw() { } virtual void on(HubUpdated, Client*) throw() { } virtual void on(Message, Client*, const OnlineUser&, const string&, bool = false) throw() { } - virtual void on(StatusMessage, Client*, const string&) throw() { } + virtual void on(StatusMessage, Client*, const string&, int = FLAG_NORMAL) throw() { } virtual void on(PrivateMessage, Client*, const OnlineUser&, const OnlineUser&, const OnlineUser&, const string&, bool = false) throw() { } virtual void on(HubUserCommand, Client*, int, int, const string&, const string&) throw() { } virtual void on(HubFull, Client*) throw() { } Index: dcpp/NmdcHub.cpp =================================================================== --- dcpp/NmdcHub.cpp (revision 1003) +++ dcpp/NmdcHub.cpp (working copy) @@ -198,6 +198,14 @@ return; } + if((line.find("Hub-Security") != string::npos) && (line.find("was kicked by") != string::npos)) { + fire(ClientListener::StatusMessage(), this, unescape(line), ClientListener::FLAG_IS_SPAM); + return; + } else if((line.find("is kicking") != string::npos) && (line.find("because:") != string::npos)) { + fire(ClientListener::StatusMessage(), this, unescape(line), ClientListener::FLAG_IS_SPAM); + return; + } + OnlineUser* ou = findUser(nick); if(ou) { fire(ClientListener::Message(), this, *ou, unescape(message)); Index: win32/HubFrame.cpp =================================================================== --- win32/HubFrame.cpp (revision 1003) +++ win32/HubFrame.cpp (working copy) @@ -877,23 +877,17 @@ } void HubFrame::on(Message, Client*, const OnlineUser& from, const string& msg, bool thirdPerson) throw() { - if(SETTING(FILTER_MESSAGES)) { - if((msg.find("Hub-Security") != string::npos) && (msg.find("was kicked by") != string::npos)) { - // Do nothing... - } else if((msg.find("is kicking") != string::npos) && (msg.find("because:") != string::npos)) { - speak(ADD_SILENT_STATUS_LINE, msg); - } else { - speak(ADD_CHAT_LINE, Util::formatMessage(from.getIdentity().getNick(), msg, thirdPerson)); - } + speak(ADD_CHAT_LINE, Util::formatMessage(from.getIdentity().getNick(), msg, thirdPerson)); +} + +void HubFrame::on(StatusMessage, Client*, const string& line, int statusFlags) throw() { + if(SETTING(FILTER_MESSAGES) && ClientListener::FLAG_IS_SPAM) { + speak(ADD_SILENT_STATUS_LINE, line); } else { - speak(ADD_CHAT_LINE, Util::formatMessage(from.getIdentity().getNick(), msg, thirdPerson)); + speak(ADD_STATUS_LINE, line); } } -void HubFrame::on(StatusMessage, Client*, const string& line) throw() { - speak(ADD_CHAT_LINE, line); -} - void HubFrame::on(PrivateMessage, Client*, const OnlineUser& from, const OnlineUser& to, const OnlineUser& replyTo, const string& line, bool thirdPerson) throw() { speak(from, to, replyTo, Util::formatMessage(from.getIdentity().getNick(), line, thirdPerson)); } Index: win32/HubFrame.h =================================================================== --- win32/HubFrame.h (revision 1003) +++ win32/HubFrame.h (working copy) @@ -275,7 +275,7 @@ virtual void on(GetPassword, Client*) throw(); virtual void on(HubUpdated, Client*) throw(); virtual void on(Message, Client*, const OnlineUser&, const string&, bool = false) throw(); - virtual void on(StatusMessage, Client*, const string&) throw(); + virtual void on(StatusMessage, Client*, const string&, int = ClientListener::FLAG_NORMAL) throw(); virtual void on(PrivateMessage, Client*, const OnlineUser&, const OnlineUser&, const OnlineUser&, const string&, bool = false) throw(); virtual void on(NickTaken, Client*) throw(); virtual void on(SearchFlood, Client*, const string&) throw();