Add event handler for m.typing

This commit is contained in:
Gergely Polonkai 2016-03-07 13:23:33 +01:00 committed by Gergely Polonkai
parent d4ce1cb06c
commit 3a39c704f1
4 changed files with 44 additions and 0 deletions

1
.gitignore vendored
View File

@ -60,3 +60,4 @@ Makefile.in
/src/matrix-event-room-message.c
/src/namespace-info.c
/src/matrix-event-room-topic.c
/src/matrix-event-typing.c

View File

@ -30,6 +30,7 @@ libmatrix_glib_0_0_la_VALA_SOURCES = \
matrix-event-room-member.vala \
matrix-event-room-message.vala \
matrix-event-room-topic.vala \
matrix-event-typing.vala \
$(NULL)
AM_CPPFLAGS += \

View File

@ -164,6 +164,9 @@ matrix_event_types_ctor(void)
matrix_event_register_type("m.room.topic",
MATRIX_EVENT_TYPE_ROOM_TOPIC,
NULL);
matrix_event_register_type("m.typing",
MATRIX_EVENT_TYPE_TYPING,
NULL);
}
void

View File

@ -0,0 +1,39 @@
/*
* 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/>.
*/
/**
* Class to hold an m.typing event.
*
* Informs the client of the list of users currently typing.
*/
public class Matrix.Event.Typing : Matrix.Event.Base {
private List<string>? _user_ids = null;
public string? room_id { get; set; default = null; }
public List<string>? user_ids {
get {
return _user_ids;
}
set {
_user_ids = value.copy();
}
default = null;
}
}