aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-09-05 16:22:36 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-09-05 16:22:36 +0200
commit2cd20e5ce1c9cfd9986b33af624023868d54a79d (patch)
tree2da13c47f05ab18f375db01955fa575bd94b9a96
parent1cd1192af7f660baf9b86524abf0b6c7204341c2 (diff)
downloadqxmpp-2cd20e5ce1c9cfd9986b33af624023868d54a79d.tar.gz
Add QXmppMucRoom::participantFullJid() to lookup an occupant full JID.
-rw-r--r--CHANGELOG4
-rw-r--r--src/client/QXmppMucManager.cpp15
-rw-r--r--src/client/QXmppMucManager.h1
3 files changed, 17 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index f07d3836..94ebc214 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,7 +4,9 @@ QXmpp 0.7.2 (Unreleased)
- Handle Error replies in QXmppDiscoveryManager so that library users can know
about errors.
- If building with Qt 5, use Qt's QDnsLookup instead of our backport.
- - Add QXmppMucRoom::ban() slot to ban users.
+ - Improve MUC scritability:
+ * Add QXmppMucRoom::ban() to ban users.
+ * Add QXmppMucRoom::participantFullJid() to lookup an occupant full JID.
QXmpp 0.7.1 (Sep 3, 2012)
-------------------------
diff --git a/src/client/QXmppMucManager.cpp b/src/client/QXmppMucManager.cpp
index 5b006af2..828b7e46 100644
--- a/src/client/QXmppMucManager.cpp
+++ b/src/client/QXmppMucManager.cpp
@@ -304,8 +304,7 @@ bool QXmppMucRoom::join()
/// Kicks the specified user from the chat room.
///
-/// \param jid
-/// \param reason
+/// The specified \a jid is the Occupant JID of the form "room@service/nick".
///
/// \return true if the request was sent, false otherwise
@@ -405,6 +404,18 @@ void QXmppMucRoom::setNickName(const QString &nickName)
}
}
+/// Returns the "Full JID" of the given participant.
+///
+/// The specified \a jid is the Occupant JID of the form "room@service/nick".
+
+QString QXmppMucRoom::participantFullJid(const QString &jid) const
+{
+ if (d->participants.contains(jid))
+ return d->participants.value(jid).mucItem().jid();
+ else
+ return QString();
+}
+
/// Returns the presence for the given participant.
///
/// \param jid
diff --git a/src/client/QXmppMucManager.h b/src/client/QXmppMucManager.h
index 77760b1f..d24a780e 100644
--- a/src/client/QXmppMucManager.h
+++ b/src/client/QXmppMucManager.h
@@ -130,6 +130,7 @@ public:
QString nickName() const;
void setNickName(const QString &nickName);
+ Q_INVOKABLE QString participantFullJid(const QString &jid) const;
QXmppPresence participantPresence(const QString &jid) const;
QStringList participants() const;