1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

mucwin_history takes ProfMucWin

This commit is contained in:
James Booth 2015-11-02 00:19:46 +00:00
parent 6ed72d8a35
commit e68784be43
4 changed files with 23 additions and 25 deletions

View File

@ -155,7 +155,10 @@ void
sv_ev_room_history(const char *const room_jid, const char *const nick, sv_ev_room_history(const char *const room_jid, const char *const nick,
GDateTime *timestamp, const char *const message) GDateTime *timestamp, const char *const message)
{ {
mucwin_history(room_jid, nick, timestamp, message); ProfMucWin *mucwin = wins_get_muc(room_jid);
if (mucwin) {
mucwin_history(mucwin, nick, timestamp, message);
}
} }
void void

View File

@ -332,13 +332,11 @@ mucwin_nick_change(ProfMucWin *mucwin, const char *const nick)
} }
void void
mucwin_history(const char *const roomjid, const char *const nick, mucwin_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp, const char *const message)
GDateTime *timestamp, const char *const message)
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); assert(mucwin != NULL);
if (window == NULL) {
log_error("Room history message received from %s, but no window open for %s", nick, roomjid); ProfWin *window = (ProfWin*)mucwin;
} else {
GString *line = g_string_new(""); GString *line = g_string_new("");
if (strncmp(message, "/me ", 4) == 0) { if (strncmp(message, "/me ", 4) == 0) {
@ -355,7 +353,6 @@ mucwin_history(const char *const roomjid, const char *const nick,
win_print(window, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", line->str); win_print(window, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", line->str);
g_string_free(line, TRUE); g_string_free(line, TRUE);
} }
}
void void
mucwin_message(const char *const roomjid, const char *const nick, mucwin_message(const char *const roomjid, const char *const nick,

View File

@ -173,8 +173,7 @@ void mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char *const ni
void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char *const nick, 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); const char *const role, const char *const affiliation, const char *const actor, const char *const reason);
void mucwin_roster(ProfMucWin *mucwin, 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, void mucwin_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp, const char *const message);
const char *const message);
void mucwin_message(const char *const roomjid, const char *const nick, const char *const message); void mucwin_message(const char *const roomjid, const char *const nick, const char *const message);
void mucwin_subject(const char *const roomjid, const char *const nick, const char *const subject); void mucwin_subject(const char *const roomjid, const char *const nick, const char *const subject);
void mucwin_requires_config(const char *const roomjid); void mucwin_requires_config(const char *const roomjid);

View File

@ -204,8 +204,7 @@ void mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char * const n
void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char * const nick, const char * const role, 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) {} const char * const affiliation, const char * const actor, const char * const reason) {}
void mucwin_roster(ProfMucWin *mucwin, 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, void mucwin_history(ProfMucWin *mucwin, const char * const nick, GDateTime *timestamp, const char * const message) {}
GDateTime *timestamp, const char * const message) {}
void mucwin_message(const char * const roomjid, const char * const nick, void mucwin_message(const char * const roomjid, const char * const nick,
const char * const message) {} const char * const message) {}
void mucwin_subject(const char * const roomjid, const char * const nick, const char * const subject) {} void mucwin_subject(const char * const roomjid, const char * const nick, const char * const subject) {}