Weakify self on presence notifications observers

This commit is contained in:
aringenbach
2022-04-05 15:21:53 +02:00
parent 10cebea479
commit d492f6764c
3 changed files with 7 additions and 1 deletions
@@ -121,7 +121,9 @@
if (!mxDirectUserPresenceObserver && self.mxRoom.isDirect)
{
// Observe contact presence change
MXWeakify(self);
mxDirectUserPresenceObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKContactManagerMatrixUserPresenceChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
MXStrongifyAndReturnIfNil(self);
NSString* directUserId = self.mxRoom.directUserId;