diff options
-rw-r--r-- | src/event/server_events.c | 2 | ||||
-rw-r--r-- | src/ui/mucwin.c | 13 | ||||
-rw-r--r-- | src/ui/ui.h | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c index d42629e5..e8f11aa3 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -286,7 +286,7 @@ sv_ev_room_history(ProfMessage *message) gboolean younger = g_date_time_compare(mucwin->last_msg_timestamp, message->timestamp) < 0 ? TRUE : FALSE; if (ev_is_first_connect() || younger ) { - mucwin_history(mucwin, message->jid->resourcepart, message->timestamp, message->plain); + mucwin_history(mucwin, message); } } } diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index f1370c88..2aaba6d8 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -361,28 +361,29 @@ mucwin_nick_change(ProfMucWin *mucwin, const char *const nick) } void -mucwin_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp, const char *const message) +mucwin_history(ProfMucWin *mucwin, const ProfMessage *const message) { assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; GString *line = g_string_new(""); + char *nick = message->jid->resourcepart; - if (strncmp(message, "/me ", 4) == 0) { + if (strncmp(message->plain, "/me ", 4) == 0) { g_string_append(line, "*"); g_string_append(line, nick); g_string_append(line, " "); - g_string_append(line, message + 4); + g_string_append(line, message->plain + 4); } else { g_string_append(line, nick); g_string_append(line, ": "); - g_string_append(line, message); + g_string_append(line, message->plain); } - win_print_history(window, timestamp, line->str); + win_print_history(window, message->timestamp, line->str); g_string_free(line, TRUE); - plugins_on_room_history_message(mucwin->roomjid, nick, message, timestamp); + plugins_on_room_history_message(mucwin->roomjid, nick, message->plain, message->timestamp); } static void diff --git a/src/ui/ui.h b/src/ui/ui.h index 1e457c73..16feda7b 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -156,7 +156,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, 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_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp, const char *const message); +void mucwin_history(ProfMucWin *mucwin, const ProfMessage *const message); void mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, const char *const id, prof_enc_t enc_mode, const char *const replace_id); void mucwin_incoming_msg(ProfMucWin *mucwin, ProfMessage *message, GSList *mentions, GList *triggers); void mucwin_subject(ProfMucWin *mucwin, const char *const nick, const char *const subject); |