Libcommuni: Fixed bug when response to PM message initated from XMPP was not sent to the same JID
This commit is contained in:
parent
32e00d4961
commit
a32e962a1a
3 changed files with 24 additions and 2 deletions
|
@ -153,6 +153,9 @@ void IRCNetworkPlugin::handleMessageSendRequest(const std::string &user, const s
|
|||
}
|
||||
|
||||
std::string target = getTargetName(legacyName);
|
||||
if (legacyName.find("/") != std::string::npos) {
|
||||
m_sessions[session]->addPM(target, legacyName.substr(0, legacyName.find("@")));
|
||||
}
|
||||
|
||||
LOG4CXX_INFO(logger, user << ": Session name: " << session << ", message to " << target);
|
||||
|
||||
|
|
|
@ -203,8 +203,22 @@ void MyIrcSession::on_messageReceived(IrcMessage *message) {
|
|||
else {
|
||||
std::string nickname = TO_UTF8(m->sender().name());
|
||||
correctNickname(nickname);
|
||||
LOG4CXX_INFO(logger, nickname + suffix);
|
||||
np->handleMessage(user, nickname + suffix, TO_UTF8(msg));
|
||||
if (m_pms.find(nickname) != m_pms.end()) {
|
||||
if (hasIRCBuddy(m_pms[nickname], nickname)) {
|
||||
LOG4CXX_INFO(logger, nickname);
|
||||
np->handleMessage(user, m_pms[nickname] + suffix, TO_UTF8(msg), nickname, "", "", false, true);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
nickname = nickname + suffix;
|
||||
}
|
||||
}
|
||||
else {
|
||||
nickname = nickname + suffix;
|
||||
}
|
||||
|
||||
LOG4CXX_INFO(logger, nickname);
|
||||
np->handleMessage(user, nickname, TO_UTF8(msg));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,6 +81,10 @@ public:
|
|||
removeIRCBuddies(channel);
|
||||
}
|
||||
|
||||
void addPM(const std::string &name, const std::string &room) {
|
||||
m_pms[name] = room;
|
||||
}
|
||||
|
||||
void setIdentify(const std::string &identify) {
|
||||
m_identify = identify;
|
||||
}
|
||||
|
@ -133,6 +137,7 @@ protected:
|
|||
bool m_connected;
|
||||
std::list<std::string> m_rooms;
|
||||
std::list<std::string> m_names;
|
||||
std::map<std::string, std::string> m_pms;
|
||||
IRCBuddyMap m_buddies;
|
||||
QTimer *m_awayTimer;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue