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:
parent
c547e5c080
commit
34b0bea889
@ -72,6 +72,12 @@ public class Matrix.Event.Presence : Matrix.Event.Base {
|
|||||||
_user_id = node.get_string();
|
_user_id = node.get_string();
|
||||||
} else if (Config.DEBUG) {
|
} else if (Config.DEBUG) {
|
||||||
warning("content.user_id is missing from the m.presence event");
|
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) {
|
if ((node = content_root.get_member("last_active_ago")) != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user