about summary refs log tree commit diff stats
path: root/src/ui/mucwin.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-11-02 00:36:25 +0000
committerJames Booth <boothj5@gmail.com>2015-11-02 00:36:25 +0000
commit2e81a4efa331c648313dd57a16fdd29c139a7e2d (patch)
tree90854d011239a9534c1ae5193b56f4ed9f7f776a /src/ui/mucwin.c
parent5c53c94253e61b2eac03a46d2aa05db3c86d2e72 (diff)
downloadprofani-tty-2e81a4efa331c648313dd57a16fdd29c139a7e2d.tar.gz
mucwin_broadcast takes ProfMucWin
Diffstat (limited to 'src/ui/mucwin.c')
-rw-r--r--src/ui/mucwin.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c
index f4e104ca..a7668479 100644
--- a/src/ui/mucwin.c
+++ b/src/ui/mucwin.c
@@ -506,25 +506,23 @@ mucwin_kick_error(ProfMucWin *mucwin, const char *const nick, const char *const
 }
 
 void
-mucwin_broadcast(const char *const roomjid, const char *const message)
+mucwin_broadcast(ProfMucWin *mucwin, const char *const message)
 {
-    ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
-    if (window == NULL) {
-        log_error("Received room broadcast, but no window open for %s.", roomjid);
-    } else {
-        int num = wins_get_num(window);
+    assert(mucwin != NULL);
 
-        win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room message: ");
-        win_vprint(window, '!', 0, NULL, NO_DATE, 0, "", "%s", message);
+    ProfWin *window = (ProfWin*)mucwin;
+    int num = wins_get_num(window);
 
-        // currently in groupchat window
-        if (wins_is_current(window)) {
-            status_bar_active(num);
+    win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room message: ");
+    win_vprint(window, '!', 0, NULL, NO_DATE, 0, "", "%s", message);
 
-        // not currently on groupchat window
-        } else {
-            status_bar_new(num);
-        }
+    // currently in groupchat window
+    if (wins_is_current(window)) {
+        status_bar_active(num);
+
+    // not currently on groupchat window
+    } else {
+        status_bar_new(num);
     }
 }