Workaround for a missing user_id in m.presence

Despite the Spec, it usually doesn’t have content.user_id, but does have sender
This commit is contained in:
Gergely Polonkai 2016-03-17 14:56:13 +01:00 committed by Gergely Polonkai
parent c547e5c080
commit 34b0bea889
1 changed files with 6 additions and 0 deletions

View File

@ -72,6 +72,12 @@ public class Matrix.Event.Presence : Matrix.Event.Base {
_user_id = node.get_string();
} else if (Config.DEBUG) {
warning("content.user_id is missing from the m.presence event");
// Workaround for having sender instead of content.user_id
// in most (room-dependent) presence events
if ((node = root.get_member("sender")) != null) {
_user_id = node.get_string();
}
}
if ((node = content_root.get_member("last_active_ago")) != null) {