summaryrefslogtreecommitdiff
path: root/finch/gntconv.c
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2020-10-03 05:58:21 -0500
committerGary Kramlich <grim@reaperworld.com>2020-10-03 05:58:21 -0500
commitcac0124838270bd3be2004e271c2e91e583d6f08 (patch)
tree5cec70b62de32748633f971b86dc5da80b797102 /finch/gntconv.c
parentd4bafb96a107397b9d1edeaafb1512aba6212962 (diff)
downloadpidgin-cac0124838270bd3be2004e271c2e91e583d6f08.tar.gz
PurpleMessage cleanups from hell
Clean up libpurple/message.[ch] and remove the messages hash table as its current implementation will not fit our future needs add a content-type property to PurpleMessage Convert message timestamps from time_t to GDateTime and set default values Make purple_message_new_outgoing take a parameter for the author. Testing Done: messages sent on bonjour, irc privmsg, irc chat, `/me` is broken i think unrelated. Reviewed at https://reviews.imfreedom.org/r/124/
Diffstat (limited to 'finch/gntconv.c')
-rw-r--r--finch/gntconv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/finch/gntconv.c b/finch/gntconv.c
index 60b985706d..24dc82d8fa 100644
--- a/finch/gntconv.c
+++ b/finch/gntconv.c
@@ -902,11 +902,14 @@ finch_write_conv(PurpleConversation *conv, PurpleMessage *msg)
/* Unnecessary to print the timestamp for delayed message */
if (purple_prefs_get_bool("/finch/conversations/timestamps")) {
- time_t mtime = purple_message_get_time(msg);
- if (!mtime)
- time(&mtime);
+ gchar *timestamp = NULL;
+
+ timestamp = purple_message_format_timestamp(msg, "(%H:%M:%S)");
+
gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv),
- purple_utf8_strftime("(%H:%M:%S)", localtime(&mtime)), gnt_color_pair(color_timestamp));
+ timestamp,
+ gnt_color_pair(color_timestamp));
+ g_free(timestamp);
}
gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), " ", GNT_TEXT_FLAG_NORMAL);