mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 22:46:21 +00:00
Retrieve message type from database
So we don't have to check for MUC another way.
This commit is contained in:
@@ -486,7 +486,7 @@ _chatwin_history(ProfChatWin *chatwin, const char *const contact_barejid)
|
||||
|
||||
while (curr) {
|
||||
ProfMessage *msg = curr->data;
|
||||
win_print_history((ProfWin*)chatwin, msg, FALSE);
|
||||
win_print_history((ProfWin*)chatwin, msg);
|
||||
curr = g_slist_next(curr);
|
||||
}
|
||||
chatwin->history_shown = TRUE;
|
||||
|
||||
@@ -373,7 +373,7 @@ mucwin_history(ProfMucWin *mucwin, const ProfMessage *const message)
|
||||
char *muc_history_color = prefs_get_string(PREF_HISTORY_COLOR_MUC);
|
||||
|
||||
if (g_strcmp0(muc_history_color, "unanimous") == 0) {
|
||||
win_print_history(window, message, TRUE);
|
||||
win_print_history(window, message);
|
||||
} else {
|
||||
char *mynick = muc_nick(mucwin->roomjid);
|
||||
GSList *mentions = get_mentions(prefs_get_boolean(PREF_NOTIFY_MENTION_WHOLE_WORD), prefs_get_boolean(PREF_NOTIFY_MENTION_CASE_SENSITIVE), message->plain, mynick);
|
||||
|
||||
@@ -1218,15 +1218,14 @@ win_print_outgoing(ProfWin *window, const char *show_char, const char *const id,
|
||||
}
|
||||
|
||||
void
|
||||
win_print_history(ProfWin *window, const ProfMessage *const message, gboolean is_muc)
|
||||
win_print_history(ProfWin *window, const ProfMessage *const message)
|
||||
{
|
||||
g_date_time_ref(message->timestamp);
|
||||
|
||||
int flags = 0;
|
||||
|
||||
// TODO: ProfMessage needs a 'type' field like we have in sql db. then we can know whether each message is a chat, muc, mucpm
|
||||
char *display_name;
|
||||
if (is_muc) {
|
||||
if (message->type == PROF_MSG_TYPE_MUC) {
|
||||
display_name = strdup(message->jid->resourcepart);
|
||||
|
||||
char *muc_history_color = prefs_get_string(PREF_HISTORY_COLOR_MUC);
|
||||
|
||||
@@ -68,7 +68,7 @@ void win_print_outgoing(ProfWin *window, const char *show_char, const char *cons
|
||||
void win_print_outgoing_with_receipt(ProfWin *window, const char *show_char, const char *const from, const char *const message, char *id, const char *const replace_id);
|
||||
void win_println_incoming_muc_msg(ProfWin *window, char *show_char, int flags, const ProfMessage *const message);
|
||||
void win_print_outgoing_muc_msg(ProfWin *window, char *show_char, const char *const me, const char *const id, const char *const replace_id, const char *const message);
|
||||
void win_print_history(ProfWin *window, const ProfMessage *const message, gboolean is_muc);
|
||||
void win_print_history(ProfWin *window, const ProfMessage *const message);
|
||||
|
||||
void win_print_http_upload(ProfWin *window, const char *const message, char *url);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user