about summary refs log tree commit diff stats
path: root/src/windows.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-01-13 03:14:36 +0000
committerJames Booth <boothj5@gmail.com>2013-01-13 03:14:36 +0000
commitec75b5e04ac59b198c2b291ddab8e81d9116c49a (patch)
tree780045ca63e0205ffcc2ceee3faae10e47b88f31 /src/windows.c
parentd827abddb7947a4872a20e3e2832cf2ae2f492ef (diff)
downloadprofani-tty-ec75b5e04ac59b198c2b291ddab8e81d9116c49a.tar.gz
Use Jid datatype in chat rooms
Diffstat (limited to 'src/windows.c')
-rw-r--r--src/windows.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/windows.c b/src/windows.c
index ccba1631..28b63c74 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -753,13 +753,16 @@ win_show_outgoing_msg(const char * const from, const char * const to,
 
     // create new window
     if (win_index == NUM_WINS) {
+        Jid *jid = jid_create(to);
 
-        if (muc_room_is_active(to)) {
+        if (muc_room_is_active(jid)) {
             win_index = _new_prof_win(to, WIN_PRIVATE);
         } else {
             win_index = _new_prof_win(to, WIN_CHAT);
         }
 
+        jid_destroy(jid);
+
         win = windows[win_index]->win;
 
         if (prefs_get_chlog() && prefs_get_history()) {
@@ -794,13 +797,13 @@ win_show_outgoing_msg(const char * const from, const char * const to,
 }
 
 void
-win_join_chat(const char * const room, const char * const nick)
+win_join_chat(Jid *jid)
 {
-    int win_index = _find_prof_win_index(room);
+    int win_index = _find_prof_win_index(jid->barejid);
 
     // create new window
     if (win_index == NUM_WINS) {
-        win_index = _new_prof_win(room, WIN_MUC);
+        win_index = _new_prof_win(jid->barejid, WIN_MUC);
     }
 
     ui_switch_win(win_index);