matrix-org / matrix-ios-sdk

The Matrix SDK for iOS
Apache License 2.0
451 stars 211 forks source link

Cannot listen events for MXUser #1837

Open kiryl09 opened 10 months ago

kiryl09 commented 10 months ago

I try to listen events related to MXUser, like presence status. I used for this MXUser::listenToUserUpdate, but it doesn't work.

I spend a little time for investigation and found that mxUser.updateListeners is always nil, but must be, as minimum, empty muttable array.

ISSUE:

When MXUser initiated with initWithUserId: it works fine, but when initiated with initWithDecoder: we have a problem, because updateListeners is not initiated.

FIX:

Could you please fix it by adding following code in MXUser::initWithCoder in next version?

updateListeners = [NSMutableArray array];

Thank you.