summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/Chat/MUCController.cpp')
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index fd3dc37..d10e6d4 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -112,2 +112,3 @@ MUCController::MUCController (
isInitialJoin_ = true;
+ chatWindowTitle_ = "";
@@ -408,6 +409,2 @@ void MUCController::handleJoinComplete(const std::string& nick) {
onUserJoined();
-
- if (isImpromptu_) {
- setImpromptuWindowTitle();
- }
}
@@ -466,3 +463,2 @@ void MUCController::handleOccupantJoined(const MUCOccupant& occupant) {
if (isImpromptu_) {
- setImpromptuWindowTitle();
onActivity("");
@@ -771,6 +767,2 @@ void MUCController::handleOccupantLeft(const MUCOccupant& occupant, MUC::Leaving
}
-
- if (isImpromptu_) {
- setImpromptuWindowTitle();
- }
}
@@ -1180,17 +1172,2 @@ Form::ref MUCController::buildImpromptuRoomConfiguration(Form::ref roomConfigura
-void MUCController::setImpromptuWindowTitle() {
- std::string title;
- std::map<std::string, MUCOccupant> occupants = muc_->getOccupants();
- if (occupants.size() <= 1) {
- title = QT_TRANSLATE_NOOP("", "Empty Chat");
- } else {
- for (const auto& pair : occupants) {
- if (pair.first != nick_) {
- title += (title.empty() ? "" : ", ") + pair.first;
- }
- }
- }
- chatWindow_->setName(title);
-}
-
void MUCController::handleRoomUnlocked() {
@@ -1263,2 +1240,7 @@ void MUCController::addChatSystemMessage() {
+void MUCController::setChatWindowTitle(const std::string& title) {
+ chatWindowTitle_ = title;
+ chatWindow_->setName(chatWindowTitle_);
+}
+
}