Add message handler for m.notice

This commit is contained in:
Gergely Polonkai 2016-03-10 17:48:23 +01:00 committed by Gergely Polonkai
parent 51cbda451c
commit 78fc89804c
4 changed files with 36 additions and 0 deletions

1
.gitignore vendored
View File

@ -85,3 +85,4 @@ Makefile.in
/src/matrix-message-base.c /src/matrix-message-base.c
/src/matrix-message-text.c /src/matrix-message-text.c
/src/matrix-message-emote.c /src/matrix-message-emote.c
/src/matrix-message-notice.c

View File

@ -53,6 +53,7 @@ libmatrix_glib_0_0_la_VALA_SOURCES = \
matrix-message-base.vala \ matrix-message-base.vala \
matrix-message-text.vala \ matrix-message-text.vala \
matrix-message-emote.vala \ matrix-message-emote.vala \
matrix-message-notice.vala \
$(NULL) $(NULL)
AM_CPPFLAGS += \ AM_CPPFLAGS += \

View File

@ -228,6 +228,9 @@ matrix_event_types_ctor(void)
matrix_message_register_type("m.emote", matrix_message_register_type("m.emote",
MATRIX_MESSAGE_TYPE_EMOTE, MATRIX_MESSAGE_TYPE_EMOTE,
NULL); NULL);
matrix_message_register_type("m.notice",
MATRIX_MESSAGE_TYPE_NOTICE,
NULL);
} }
void void

View File

@ -0,0 +1,31 @@
/*
* 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
* <http://www.gnu.org/licenses/>.
*/
/**
* Message type to hold a m.notice message
*
* A m.notice message should be considered similar to a plain m.text
* message except that clients should visually distinguish it in some
* way. It is intended to be used by automated clients, such as bots,
* bridges, and other entities, rather than humans. Additionally, such
* automated agents which watch a room for messages and respond to
* them ought to ignore m.notice messages. This helps to prevent
* infinite-loop situations where two automated clients continuously
* exchange messages, as each responds to the other.
*/
public class Matrix.Message.Notice : Matrix.Message.Base {}