Move Event types to the Matrix.Event namespace

This commit is contained in:
2016-03-07 09:44:06 +01:00
committed by Gergely Polonkai
parent 5f0b877db1
commit 70dfaff080
18 changed files with 497 additions and 479 deletions

View File

@@ -81,7 +81,7 @@ public class Matrix.HTTPClient : Matrix.HTTPAPI, Matrix.Client {
Json.Object root_obj;
Json.Node node;
string event_type;
Matrix.Event evt;
Matrix.Event.Base? evt = null;
if (event_node.get_node_type() != Json.NodeType.OBJECT) {
if (Config.DEBUG) {
@@ -104,19 +104,9 @@ public class Matrix.HTTPClient : Matrix.HTTPAPI, Matrix.Client {
event_type = node.get_string();
try {
evt = Matrix.Event.new_from_json(event_type, room_id, event_node);
} catch (Matrix.Error e) {
if (Config.DEBUG) {
warning("Error during event creation: %s", e.message);
}
return;
evt = Matrix.Event.Base.new_from_json(event_type, event_node);
} catch (GLib.Error e) {
if (Config.DEBUG) {
warning("Error during event creation: %s", e.message);
}
return;
evt = null;
}
incoming_event(room_id, event_node, evt);