summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client/NickResolver.cpp')
-rw-r--r--Swiften/Client/NickResolver.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/Client/NickResolver.cpp b/Swiften/Client/NickResolver.cpp
index 9bfe269..3e1ae8e 100644
--- a/Swiften/Client/NickResolver.cpp
+++ b/Swiften/Client/NickResolver.cpp
@@ -28,12 +28,18 @@ NickResolver::NickResolver(const JID& ownJID, XMPPRoster* xmppRoster, VCardManag
}
mucRegistry_ = mucRegistry;
xmppRoster_->onJIDUpdated.connect(boost::bind(&NickResolver::handleJIDUpdated, this, _1, _2, _3));
+ xmppRoster_->onJIDAdded.connect(boost::bind(&NickResolver::handleJIDAdded, this, _1));
}
void NickResolver::handleJIDUpdated(const JID& jid, const String& previousNick, const std::vector<String>& /*groups*/) {
onNickChanged(jid, previousNick);
}
+void NickResolver::handleJIDAdded(const JID& jid) {
+ String oldNick(jidToNick(jid));
+ onNickChanged(jid, oldNick);
+}
+
String NickResolver::jidToNick(const JID& jid) {
if (jid.toBare() == ownJID_) {
if (!ownNick_.isEmpty()) {