summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-06-20 17:38:19 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-06-20 17:38:19 (GMT)
commitdfea757fd085ca9386b96db58c5d2bcd6173a917 (patch)
tree9251fa1b1121fb0f90a569ecc5b31014d7e217b5 /Swift
parentf6635d1eee1235710c61e3fad76a161959185323 (diff)
downloadswift-dfea757fd085ca9386b96db58c5d2bcd6173a917.zip
swift-dfea757fd085ca9386b96db58c5d2bcd6173a917.tar.bz2
Show subjects on MUC join.
Resolves: #472
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp2
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 824c98d..ea38f1f 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -215,7 +215,7 @@ void ChatsManager::handleJoinMUCRequest(const JID &muc, const boost::optional<St
void ChatsManager::handleIncomingMessage(boost::shared_ptr<Message> message) {
JID jid = message->getFrom();
boost::shared_ptr<MessageEvent> event(new MessageEvent(message));
- if (!event->isReadable() && !message->getPayload<ChatState>()) {
+ if (!event->isReadable() && !message->getPayload<ChatState>() && message->getSubject().isEmpty()) {
return;
}
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index 2f74713..6029a14 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -194,6 +194,10 @@ void MUCController::preHandleIncomingMessage(boost::shared_ptr<Message> message)
/*Buggy implementations never send the status code, so use an incoming message as a hint that joining's done (e.g. the old ejabberd on psi-im.org).*/
receivedActivity();
joined_ = true;
+
+ if (!message->getSubject().isEmpty() && message->getBody().isEmpty()) {
+ chatWindow_->addSystemMessage("The room subject is now: " + message->getSubject());
+ }
}
void MUCController::handleOccupantRoleChanged(const String& nick, const MUCOccupant& occupant, const MUCOccupant::Role& oldRole) {