aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/QXmppMucManager.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/client/QXmppMucManager.cpp b/src/client/QXmppMucManager.cpp
index 828b7e46..c5dd4beb 100644
--- a/src/client/QXmppMucManager.cpp
+++ b/src/client/QXmppMucManager.cpp
@@ -228,29 +228,20 @@ QXmppMucRoom::Actions QXmppMucRoom::allowedActions() const
/// Bans the specified user from the chat room.
///
-/// The specified \a jid can be either an "anonymized" room participant JID
-/// such of the form theroom@conference.example.com/nickname or a real JID.
+/// The specified \a jid is the Bare JID of the form "user@host".
///
/// \return true if the request was sent, false otherwise
bool QXmppMucRoom::ban(const QString &jid, const QString &reason)
{
- QString realJid;
- if (QXmppUtils::jidToBareJid(jid) == d->jid) {
- // an "anonymized" JID was specified, look up the real JID
- if (d->participants.contains(jid))
- realJid = d->participants.value(jid).mucItem().jid();
- if (realJid.isEmpty()) {
- qWarning("Coud not determine real JID for %s", qPrintable(jid));
- return false;
- }
- } else {
- realJid = jid;
+ if (!QXmppUtils::jidToResource(jid).isEmpty()) {
+ qWarning("QXmppMucRoom::ban expects a bare JID");
+ return false;
}
QXmppMucItem item;
item.setAffiliation(QXmppMucItem::OutcastAffiliation);
- item.setJid(realJid);
+ item.setJid(jid);
item.setReason(reason);
QXmppMucAdminIq iq;