aboutsummaryrefslogtreecommitdiffstats
path: root/matrix-sync.c
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2015-11-19 10:42:38 +0000
committerRichard van der Hoff <richard@matrix.org>2015-11-19 10:42:38 +0000
commit38079edc780acdf8b6ad85a72b4f3a2e316e5d87 (patch)
tree4215bd60d5038cea3efa5a1c4b02e50e31b9f82d /matrix-sync.c
parenteef1f40be66ccd1aa89394ed98ff06304674307a (diff)
downloadpurple-matrix-38079edc780acdf8b6ad85a72b4f3a2e316e5d87.tar.gz
Handle state events which arrive in the timeline
Post-SPEC-254, we now need to handle state events which arrive in the timeline.
Diffstat (limited to 'matrix-sync.c')
-rw-r--r--matrix-sync.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/matrix-sync.c b/matrix-sync.c
index 37ecf47..d2db06e 100644
--- a/matrix-sync.c
+++ b/matrix-sync.c
@@ -71,10 +71,16 @@ static void _parse_room_event(JsonArray *event_array, guint event_idx,
return;
}
- if(data->state_events)
+ if(data->state_events) {
matrix_room_handle_state_event(conv, event_id, json_event_obj);
- else
- matrix_room_handle_timeline_event(conv, event_id, json_event_obj);
+ } else {
+ if(json_object_has_member(json_event_obj, "state_key")) {
+ matrix_room_handle_state_event(conv, event_id, json_event_obj);
+ matrix_room_complete_state_update(conv, TRUE);
+ } else {
+ matrix_room_handle_timeline_event(conv, event_id, json_event_obj);
+ }
+ }
}
/**