From 1f1bc94bbd679c39425f75f2422797d508c2a87f Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 10 Mar 2016 15:42:30 +0100 Subject: [PATCH] Add message handler for m.text --- .gitignore | 1 + src/Makefile.am | 1 + src/matrix-event-types.c | 4 ++++ src/matrix-message-text.vala | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 src/matrix-message-text.vala diff --git a/.gitignore b/.gitignore index f9259fb..77f6651 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,4 @@ Makefile.in /src/matrix-event-call-base.c /src/matrix-glib-0.0.pc /src/matrix-message-base.c +/src/matrix-message-text.c diff --git a/src/Makefile.am b/src/Makefile.am index 1508c15..71d6aae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -51,6 +51,7 @@ libmatrix_glib_0_0_la_VALA_SOURCES = \ matrix-event-call-answer.vala \ matrix-event-call-hangup.vala \ matrix-message-base.vala \ + matrix-message-text.vala \ $(NULL) AM_CPPFLAGS += \ diff --git a/src/matrix-event-types.c b/src/matrix-event-types.c index 95ce471..32735ef 100644 --- a/src/matrix-event-types.c +++ b/src/matrix-event-types.c @@ -221,6 +221,10 @@ matrix_event_types_ctor(void) matrix_event_register_type("m.call.hangup", MATRIX_EVENT_TYPE_CALL_HANGUP, NULL); + + matrix_message_register_type("m.text", + MATRIX_MESSAGE_TYPE_TEXT, + NULL); } void diff --git a/src/matrix-message-text.vala b/src/matrix-message-text.vala new file mode 100644 index 0000000..b6dd377 --- /dev/null +++ b/src/matrix-message-text.vala @@ -0,0 +1,24 @@ +/* + * 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 + * . + */ + +/** + * Message handler for plain text messages + * + * Handle plain text messages. + */ +public class Matrix.Message.Text : Matrix.Message.Base {}