diff --git a/.gitignore b/.gitignore index 77f6651..ac5d984 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,4 @@ Makefile.in /src/matrix-glib-0.0.pc /src/matrix-message-base.c /src/matrix-message-text.c +/src/matrix-message-emote.c diff --git a/src/Makefile.am b/src/Makefile.am index 71d6aae..a277dec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,6 +52,7 @@ libmatrix_glib_0_0_la_VALA_SOURCES = \ matrix-event-call-hangup.vala \ matrix-message-base.vala \ matrix-message-text.vala \ + matrix-message-emote.vala \ $(NULL) AM_CPPFLAGS += \ diff --git a/src/matrix-event-types.c b/src/matrix-event-types.c index 32735ef..c8c4042 100644 --- a/src/matrix-event-types.c +++ b/src/matrix-event-types.c @@ -225,6 +225,9 @@ matrix_event_types_ctor(void) matrix_message_register_type("m.text", MATRIX_MESSAGE_TYPE_TEXT, NULL); + matrix_message_register_type("m.emote", + MATRIX_MESSAGE_TYPE_EMOTE, + NULL); } void diff --git a/src/matrix-message-emote.vala b/src/matrix-message-emote.vala new file mode 100644 index 0000000..d8fa0bb --- /dev/null +++ b/src/matrix-message-emote.vala @@ -0,0 +1,28 @@ +/* + * This file is part of matrix-glib-sdk + * + * matrix-glib-sdk is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * matrix-glib-sdk is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with matrix-glib-sdk. If not, see + * . + */ + +/** + * The emote message type + * + * This message is similar to `m.text` except that the sender is + * 'performing' the action contained in the `body` key, similar to + * `/me` in IRC. This message should be prefixed by the name of the + * sender. This message could also be represented in a different + * colour to distinguish it from regular `m.text` messages. + */ +public class Matrix.Message.Emote : Matrix.Message.Base {}