summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-10-19 11:03:21 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-10-19 15:36:21 (GMT)
commit30359b48e18bcf171a53d50d84a178b9cb376d7a (patch)
tree42b59ff30433bf7d3f164aa64639312e865d2d4b /Swift
parentb951e04a08f368dad564995813323fd098c70e95 (diff)
downloadswift-contrib-30359b48e18bcf171a53d50d84a178b9cb376d7a.zip
swift-contrib-30359b48e18bcf171a53d50d84a178b9cb376d7a.tar.bz2
Use real JID for bans, not room JID.
Resolves: #1020
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index 6d3f9f2..1120f4b 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -126,12 +126,18 @@ void MUCController::handleWindowOccupantSelectionChanged(ContactRosterItem* item
}
void MUCController::handleActionRequestedOnOccupant(ChatWindow::OccupantAction action, ContactRosterItem* item) {
+ JID mucJID = item->getJID();
+ MUCOccupant occupant = muc_->getOccupant(mucJID.getResource());
+ JID realJID;
+ if (occupant.getRealJID()) {
+ realJID = occupant.getRealJID().get();
+ }
switch (action) {
- case ChatWindow::Kick: muc_->kickOccupant(item->getJID());break;
- case ChatWindow::Ban: muc_->changeAffiliation(item->getJID(), MUCOccupant::Outcast);break;
- case ChatWindow::MakeModerator: muc_->changeOccupantRole(item->getJID(), MUCOccupant::Moderator);break;
- case ChatWindow::MakeParticipant: muc_->changeOccupantRole(item->getJID(), MUCOccupant::Participant);break;
- case ChatWindow::MakeVisitor: muc_->changeOccupantRole(item->getJID(), MUCOccupant::Visitor);break;
+ case ChatWindow::Kick: muc_->kickOccupant(mucJID);break;
+ case ChatWindow::Ban: muc_->changeAffiliation(realJID, MUCOccupant::Outcast);break;
+ case ChatWindow::MakeModerator: muc_->changeOccupantRole(mucJID, MUCOccupant::Moderator);break;
+ case ChatWindow::MakeParticipant: muc_->changeOccupantRole(mucJID, MUCOccupant::Participant);break;
+ case ChatWindow::MakeVisitor: muc_->changeOccupantRole(mucJID, MUCOccupant::Visitor);break;
}
}