summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-06-04 22:09:21 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-06-04 22:42:02 (GMT)
commit7bca08eb2829982865f1649483f9aa01b3413b1c (patch)
tree630b333f0dd9b05478816eae27c6695b1a6bbe35 /Swift/Controllers
parentb3208697addc0492f4ae1f76c75a8810c20e701a (diff)
downloadswift-contrib-7bca08eb2829982865f1649483f9aa01b3413b1c.zip
swift-contrib-7bca08eb2829982865f1649483f9aa01b3413b1c.tar.bz2
Starting towards tooltips for the colour-blind.
Putting status show names along with the text in tooltips. Covers the MeView and roster entries. Still ToDo: status setter Resolves: #429
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp16
-rw-r--r--Swift/Controllers/Chat/MUCController.h2
-rw-r--r--Swift/Controllers/RosterController.cpp6
3 files changed, 16 insertions, 8 deletions
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index e582f1b..14fe180 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -141,7 +141,11 @@ void MUCController::handleWindowClosed() {
void MUCController::handleOccupantJoined(const MUCOccupant& occupant) {
receivedActivity();
JID jid(nickToJID(occupant.getNick()));
- roster_->addContact(jid, occupant.getNick(), roleToGroupName(occupant.getRole()));
+ JID realJID;
+ if (occupant.getRealJID()) {
+ realJID = occupant.getRealJID().get();
+ }
+ roster_->addContact(jid, realJID, occupant.getNick(), roleToGroupName(occupant.getRole()));
if (joined_) {
String joinString = occupant.getNick() + " has joined the room";
MUCOccupant::Role role = occupant.getRole();
@@ -177,12 +181,16 @@ void MUCController::preHandleIncomingMessage(boost::shared_ptr<Message>) {
joined_ = true;
}
-void MUCController::handleOccupantRoleChanged(const String& nick, const MUCOccupant::Role& newRole, const MUCOccupant::Role& oldRole) {
+void MUCController::handleOccupantRoleChanged(const String& nick, const MUCOccupant& occupant, const MUCOccupant::Role& oldRole) {
receivedActivity();
JID jid(nickToJID(nick));
roster_->removeContactFromGroup(jid, roleToGroupName(oldRole));
- roster_->addContact(jid, nick, roleToGroupName(newRole));
- chatWindow_->addSystemMessage(nick + " is now a " + roleToFriendlyName(newRole));
+ JID realJID;
+ if (occupant.getRealJID()) {
+ realJID = occupant.getRealJID().get();
+ }
+ roster_->addContact(jid, realJID, nick, roleToGroupName(occupant.getRole()));
+ chatWindow_->addSystemMessage(nick + " is now a " + roleToFriendlyName(occupant.getRole()));
}
String MUCController::roleToGroupName(MUCOccupant::Role role) {
diff --git a/Swift/Controllers/Chat/MUCController.h b/Swift/Controllers/Chat/MUCController.h
index bf46a08..f409309 100644
--- a/Swift/Controllers/Chat/MUCController.h
+++ b/Swift/Controllers/Chat/MUCController.h
@@ -46,7 +46,7 @@ namespace Swift {
void handleOccupantJoined(const MUCOccupant& occupant);
void handleOccupantLeft(const MUCOccupant& occupant, MUC::LeavingType type, const String& reason);
void handleOccupantPresenceChange(boost::shared_ptr<Presence> presence);
- void handleOccupantRoleChanged(const String& nick, const MUCOccupant::Role& newRole, const MUCOccupant::Role& oldRole);
+ void handleOccupantRoleChanged(const String& nick, const MUCOccupant& occupant,const MUCOccupant::Role& oldRole);
void handleJoinComplete(const String& nick);
void handleJoinFailed(boost::shared_ptr<ErrorPayload> error);
void handleJoinTimeoutTick();
diff --git a/Swift/Controllers/RosterController.cpp b/Swift/Controllers/RosterController.cpp
index 191d5fb..46248a1 100644
--- a/Swift/Controllers/RosterController.cpp
+++ b/Swift/Controllers/RosterController.cpp
@@ -104,10 +104,10 @@ void RosterController::handleOnJIDAdded(const JID& jid) {
String name = nickResolver_->jidToNick(jid);
if (!groups.empty()) {
foreach(const String& group, groups) {
- roster_->addContact(jid, name, group);
+ roster_->addContact(jid, jid, name, group);
}
} else {
- roster_->addContact(jid, name, "Contacts");
+ roster_->addContact(jid, jid, name, "Contacts");
}
}
@@ -132,7 +132,7 @@ void RosterController::handleOnJIDUpdated(const JID& jid, const String& oldName,
}
foreach(const String& group, groups) {
if (std::find(oldGroups.begin(), oldGroups.end(), group) == oldGroups.end()) {
- roster_->addContact(jid, xmppRoster_->getNameForJID(jid), group);
+ roster_->addContact(jid, jid, xmppRoster_->getNameForJID(jid), group);
}
}
foreach(const String& group, oldGroups) {