Use Jid datatype in chat rooms

This commit is contained in:
James Booth
2013-01-13 03:14:36 +00:00
parent d827abddb7
commit ec75b5e04a
9 changed files with 138 additions and 119 deletions

View File

@@ -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);