aboutsummaryrefslogtreecommitdiffstats
path: root/matrix-room.c
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2015-11-02 17:27:04 +0000
committerRichard van der Hoff <richard@matrix.org>2015-11-02 17:27:04 +0000
commite78ea22ac644ecb3bb08ca2059068825fc77324c (patch)
tree168146aeee977b2d8037bb40ab4a3a4cfb5f139b /matrix-room.c
parentc0b7ecec629c6b31cac5782c8c9b0bcdf5b62772 (diff)
downloadpurple-matrix-e78ea22ac644ecb3bb08ca2059068825fc77324c.tar.gz
Show correct displayname on our own outgoing messages
Make the displayname on our sent messages match that in the member list for the room.
Diffstat (limited to 'matrix-room.c')
-rw-r--r--matrix-room.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/matrix-room.c b/matrix-room.c
index 5291f60..d53b6e4 100644
--- a/matrix-room.c
+++ b/matrix-room.c
@@ -580,6 +580,16 @@ void matrix_room_complete_state_update(PurpleConversation *conv,
}
+static const gchar *_get_my_display_name(PurpleConversation *conv)
+{
+ MatrixConnectionData *conn = _get_connection_data_from_conversation(conv);
+ MatrixRoomMemberTable *member_table =
+ matrix_room_get_member_table(conv);
+
+ return matrix_roommembers_get_displayname_for_member(
+ member_table, conn->user_id);
+}
+
/**
* Send a message in a room
*/
@@ -595,6 +605,6 @@ void matrix_room_send_message(PurpleConversation *conv, const gchar *message)
_enqueue_event(conv, "m.room.message", content);
json_object_unref(content);
- purple_conv_chat_write(chat, purple_conv_chat_get_nick(chat),
+ purple_conv_chat_write(chat, _get_my_display_name(conv),
message, PURPLE_MESSAGE_SEND, g_get_real_time()/1000/1000);
}