From d25d6b450201ee58f41e55d57da093eafa25e20c Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 28 Sep 2014 22:09:20 +0100 Subject: Tidied muc module --- src/ui/console.c | 4 ++-- src/ui/core.c | 20 ++++++++++---------- src/ui/notifier.c | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/ui') diff --git a/src/ui/console.c b/src/ui/console.c index 01be3464..a45b2faa 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -454,7 +454,7 @@ _cons_show_bookmarks(const GList *list) int presence_colour = 0; - if (muc_room_is_active(item->jid)) { + if (muc_active(item->jid)) { presence_colour = COLOUR_ONLINE; } win_save_vprint(console, '-', NULL, NO_EOL, presence_colour, "", " %s", item->jid); @@ -467,7 +467,7 @@ _cons_show_bookmarks(const GList *list) if (item->password != NULL) { win_save_print(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " (private)"); } - if (muc_room_is_active(item->jid)) { + if (muc_active(item->jid)) { ProfWin *roomwin = wins_get_by_recipient(item->jid); if (roomwin != NULL) { int num = wins_get_num(roomwin); diff --git a/src/ui/core.c b/src/ui/core.c index b5c01896..aeaa8512 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -1207,7 +1207,7 @@ _ui_new_chat_win(const char * const to) if (window == NULL) { Jid *jid = jid_create(to); - if (muc_room_is_active(jid->barejid)) { + if (muc_active(jid->barejid)) { window = wins_new(to, WIN_PRIVATE); } else { window = wins_new(to, WIN_CHAT); @@ -1324,7 +1324,7 @@ _ui_outgoing_msg(const char * const from, const char * const to, if (window == NULL) { Jid *jid = jid_create(to); - if (muc_room_is_active(jid->barejid)) { + if (muc_active(jid->barejid)) { window = wins_new(to, WIN_PRIVATE); } else { window = wins_new(to, WIN_CHAT); @@ -1377,7 +1377,7 @@ _ui_room_join(const char * const room, gboolean focus) } else { status_bar_active(num); ProfWin *console = wins_get_console(); - char *nick = muc_get_room_nick(room); + char *nick = muc_nick(room); win_save_vprint(console, '!', NULL, 0, COLOUR_TYPING, "", "-> Autojoined %s as %s (%d).", room, nick, num); } } @@ -1400,7 +1400,7 @@ _ui_room_roster(const char * const room, GList *roster, const char * const prese if (presence == NULL) { length++; win_save_vprint(window, '!', NULL, NO_EOL, COLOUR_ROOMINFO, "", "%d participants: ", length); - win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, COLOUR_ONLINE, "", "%s", muc_get_room_nick(room)); + win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, COLOUR_ONLINE, "", "%s", muc_nick(room)); win_save_print(window, '!', NULL, NO_DATE | NO_EOL, 0, "", ", "); } else { win_save_vprint(window, '!', NULL, NO_EOL, COLOUR_ROOMINFO, "", "%d %s: ", length, presence); @@ -1531,7 +1531,7 @@ _ui_room_message(const char * const room_jid, const char * const nick, log_error("Room message received from %s, but no window open for %s", nick, room_jid); } else { int num = wins_get_num(window); - char *my_nick = muc_get_room_nick(room_jid); + char *my_nick = muc_nick(room_jid); if (strcmp(nick, my_nick) != 0) { if (g_strrstr(message, my_nick) != NULL) { @@ -1566,7 +1566,7 @@ _ui_room_message(const char * const room_jid, const char * const nick, ui_index = 0; } - if (strcmp(nick, muc_get_room_nick(room_jid)) != 0) { + if (strcmp(nick, muc_nick(room_jid)) != 0) { if (prefs_get_boolean(PREF_BEEP)) { beep(); } @@ -1731,7 +1731,7 @@ static void _ui_status_private(void) { Jid *jid = jid_create(ui_current_recipient()); - PContact pcontact = muc_get_participant(jid->barejid, jid->resourcepart); + PContact pcontact = muc_roster_item(jid->barejid, jid->resourcepart); ProfWin *window = wins_get_current(); if (pcontact != NULL) { @@ -1747,7 +1747,7 @@ static void _ui_info_private(void) { Jid *jid = jid_create(ui_current_recipient()); - PContact pcontact = muc_get_participant(jid->barejid, jid->resourcepart); + PContact pcontact = muc_roster_item(jid->barejid, jid->resourcepart); ProfWin *window = wins_get_current(); if (pcontact != NULL) { @@ -1762,7 +1762,7 @@ _ui_info_private(void) static void _ui_status_room(const char * const contact) { - PContact pcontact = muc_get_participant(ui_current_recipient(), contact); + PContact pcontact = muc_roster_item(ui_current_recipient(), contact); ProfWin *current = wins_get_current(); if (pcontact != NULL) { @@ -1775,7 +1775,7 @@ _ui_status_room(const char * const contact) static void _ui_info_room(const char * const contact) { - PContact pcontact = muc_get_participant(ui_current_recipient(), contact); + PContact pcontact = muc_roster_item(ui_current_recipient(), contact); ProfWin *current = wins_get_current(); if (pcontact != NULL) { diff --git a/src/ui/notifier.c b/src/ui/notifier.c index 6673edb0..81320383 100644 --- a/src/ui/notifier.c +++ b/src/ui/notifier.c @@ -129,7 +129,7 @@ static void _notify_remind(void) { gint unread = ui_unread(); - gint open = muc_invite_count(); + gint open = muc_invites_count(); gint subs = presence_sub_request_count(); GString *text = g_string_new(""); -- cgit 1.4.1-2-gfad0