about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/mucwin.c50
-rw-r--r--src/ui/ui.h2
2 files changed, 25 insertions, 27 deletions
diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c
index 9b77cf7d..238db218 100644
--- a/src/ui/mucwin.c
+++ b/src/ui/mucwin.c
@@ -463,39 +463,37 @@ mucwin_requires_config(ProfMucWin *mucwin)
 }
 
 void
-mucwin_subject(const char *const roomjid, const char *const nick, const char *const subject)
+mucwin_subject(ProfMucWin *mucwin, const char *const nick, const char *const subject)
 {
-    ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
-    if (window == NULL) {
-        log_error("Received room subject, but no window open for %s.", roomjid);
-    } else {
-        int num = wins_get_num(window);
+    assert(mucwin != NULL);
 
-        if (subject) {
-            if (nick) {
-                win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "*%s has set the room subject: ", nick);
-                win_vprint(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject);
-            } else {
-                win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: ");
-                win_vprint(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject);
-            }
+    ProfWin *window = (ProfWin*)mucwin;
+    int num = wins_get_num(window);
+
+    if (subject) {
+        if (nick) {
+            win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "*%s has set the room subject: ", nick);
+            win_vprint(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject);
         } else {
-            if (nick) {
-                win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "*%s has cleared the room subject.", nick);
-            } else {
-                win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room subject cleared");
-            }
+            win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: ");
+            win_vprint(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject);
         }
-
-        // currently in groupchat window
-        if (wins_is_current(window)) {
-            status_bar_active(num);
-
-        // not currently on groupchat window
+    } else {
+        if (nick) {
+            win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "*%s has cleared the room subject.", nick);
         } else {
-            status_bar_active(num);
+            win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room subject cleared");
         }
     }
+
+    // currently in groupchat window
+    if (wins_is_current(window)) {
+        status_bar_active(num);
+
+    // not currently on groupchat window
+    } else {
+        status_bar_active(num);
+    }
 }
 
 void
diff --git a/src/ui/ui.h b/src/ui/ui.h
index a85e429f..3ce0fea7 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -175,7 +175,7 @@ void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char
 void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char *const presence);
 void mucwin_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp, const char *const message);
 void mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const message);
-void mucwin_subject(const char *const roomjid, const char *const nick, const char *const subject);
+void mucwin_subject(ProfMucWin *mucwin, const char *const nick, const char *const subject);
 void mucwin_requires_config(ProfMucWin *mucwin);
 void mucwin_info(ProfMucWin *mucwin);
 void mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role);