mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
mucwin_broadcast takes ProfMucWin
This commit is contained in:
parent
5c53c94253
commit
2e81a4efa3
@ -136,7 +136,10 @@ void
|
||||
sv_ev_room_broadcast(const char *const room_jid, const char *const message)
|
||||
{
|
||||
if (muc_roster_complete(room_jid)) {
|
||||
mucwin_broadcast(room_jid, message);
|
||||
ProfMucWin *mucwin = wins_get_muc(room_jid);
|
||||
if (mucwin) {
|
||||
mucwin_broadcast(mucwin, message);
|
||||
}
|
||||
} else {
|
||||
muc_pending_broadcasts_add(room_jid, message);
|
||||
}
|
||||
@ -587,10 +590,10 @@ sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean c
|
||||
}
|
||||
|
||||
GList *pending_broadcasts = muc_pending_broadcasts(room);
|
||||
if (pending_broadcasts) {
|
||||
if (mucwin && pending_broadcasts) {
|
||||
GList *curr = pending_broadcasts;
|
||||
while (curr) {
|
||||
mucwin_broadcast(room, curr->data);
|
||||
mucwin_broadcast(mucwin, curr->data);
|
||||
curr = g_list_next(curr);
|
||||
}
|
||||
}
|
||||
|
@ -506,12 +506,11 @@ 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 {
|
||||
assert(mucwin != NULL);
|
||||
|
||||
ProfWin *window = (ProfWin*)mucwin;
|
||||
int num = wins_get_num(window);
|
||||
|
||||
win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room message: ");
|
||||
@ -526,7 +525,6 @@ mucwin_broadcast(const char *const roomjid, const char *const message)
|
||||
status_bar_new(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
mucwin_affiliation_list_error(const char *const roomjid, const char *const affiliation,
|
||||
|
@ -186,7 +186,7 @@ void mucwin_occupant_kicked(ProfMucWin *mucwin, const char *const nick, const ch
|
||||
const char *const reason);
|
||||
void mucwin_occupant_banned(ProfMucWin *mucwin, const char *const nick, const char *const actor,
|
||||
const char *const reason);
|
||||
void mucwin_broadcast(const char *const roomjid, const char *const message);
|
||||
void mucwin_broadcast(ProfMucWin *mucwin, const char *const message);
|
||||
void mucwin_occupant_offline(ProfMucWin *mucwin, const char *const nick);
|
||||
void mucwin_occupant_online(ProfMucWin *mucwin, const char *const nick, const char *const roles,
|
||||
const char *const affiliation, const char *const show, const char *const status);
|
||||
|
@ -223,8 +223,7 @@ void ui_room_banned(const char * const roomjid, const char * const actor, const
|
||||
void mucwin_occupant_banned(ProfMucWin *mucwin, const char * const nick, const char * const actor,
|
||||
const char * const reason) {}
|
||||
void ui_leave_room(const char * const roomjid) {}
|
||||
void mucwin_broadcast(const char * const roomjid,
|
||||
const char * const message) {}
|
||||
void mucwin_broadcast(ProfMucWin *mucwin, const char * const message) {}
|
||||
void mucwin_occupant_offline(ProfMucWin *mucwin, const char * const nick) {}
|
||||
void mucwin_occupant_online(ProfMucWin *mucwin, const char * const nick, const char * const roles,
|
||||
const char * const affiliation, const char * const show, const char * const status) {}
|
||||
|
Loading…
Reference in New Issue
Block a user