0
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-07-26 12:14:28 -04:00

mucwin_roster takes ProfMucWin

This commit is contained in:
James Booth 2015-11-01 23:41:45 +00:00
parent d21faa4609
commit 8b4bb1c7f1
5 changed files with 40 additions and 41 deletions

View File

@ -1158,7 +1158,7 @@ _who_room(ProfWin *window, const char *const command, gchar **args)
// no arg, show all contacts
if ((presence == NULL) || (g_strcmp0(presence, "any") == 0)) {
mucwin_roster(mucwin->roomjid, occupants, NULL);
mucwin_roster(mucwin, occupants, NULL);
// available
} else if (strcmp("available", presence) == 0) {
@ -1172,7 +1172,7 @@ _who_room(ProfWin *window, const char *const command, gchar **args)
occupants = g_list_next(occupants);
}
mucwin_roster(mucwin->roomjid, filtered, "available");
mucwin_roster(mucwin, filtered, "available");
// unavailable
} else if (strcmp("unavailable", presence) == 0) {
@ -1186,7 +1186,7 @@ _who_room(ProfWin *window, const char *const command, gchar **args)
occupants = g_list_next(occupants);
}
mucwin_roster(mucwin->roomjid, filtered, "unavailable");
mucwin_roster(mucwin, filtered, "unavailable");
// show specific status
} else {
@ -1201,7 +1201,7 @@ _who_room(ProfWin *window, const char *const command, gchar **args)
occupants = g_list_next(occupants);
}
mucwin_roster(mucwin->roomjid, filtered, presence);
mucwin_roster(mucwin, filtered, presence);
}
g_list_free(occupants);

View File

@ -557,9 +557,10 @@ sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean c
muc_roster_set_complete(room);
// show roster if occupants list disabled by default
if (!prefs_get_boolean(PREF_OCCUPANTS)) {
ProfMucWin *mucwin = wins_get_muc(room);
if (mucwin && !prefs_get_boolean(PREF_OCCUPANTS)) {
GList *occupants = muc_roster(room);
mucwin_roster(room, occupants, NULL);
mucwin_roster(mucwin, occupants, NULL);
g_list_free(occupants);
}

View File

@ -194,12 +194,11 @@ mucwin_room_disco_info(ProfMucWin *mucwin, GSList *identities, GSList *features)
}
void
mucwin_roster(const char *const roomjid, GList *roster, const char *const presence)
mucwin_roster(ProfMucWin *mucwin, GList *roster, const char *const presence)
{
ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window == NULL) {
log_error("Received room roster but no window open for %s.", roomjid);
} else {
assert(mucwin != NULL);
ProfWin *window = (ProfWin*)mucwin;
if ((roster == NULL) || (g_list_length(roster) == 0)) {
if (presence == NULL) {
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room is empty.");
@ -231,7 +230,6 @@ mucwin_roster(const char *const roomjid, GList *roster, const char *const presen
}
}
}
void
mucwin_occupant_offline(const char *const roomjid, const char *const nick)

View File

@ -172,7 +172,7 @@ void mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char *const ni
const char *const affiliation, const char *const actor, const char *const reason);
void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char *const nick,
const char *const role, const char *const affiliation, const char *const actor, const char *const reason);
void mucwin_roster(const char *const roomjid, GList *occupants, const char *const presence);
void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char *const presence);
void mucwin_history(const char *const roomjid, const char *const nick, GDateTime *timestamp,
const char *const message);
void mucwin_message(const char *const roomjid, const char *const nick, const char *const message);

View File

@ -203,7 +203,7 @@ void mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char * const n
const char * const actor, const char * const reason) {}
void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char * const nick, const char * const role,
const char * const affiliation, const char * const actor, const char * const reason) {}
void mucwin_roster(const char * const roomjid, GList *occupants, const char * const presence) {}
void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char * const presence) {}
void mucwin_history(const char * const roomjid, const char * const nick,
GDateTime *timestamp, const char * const message) {}
void mucwin_message(const char * const roomjid, const char * const nick,