In the method mentioned below, the presence of XMPPRoomOccupantMemoryStorageObject is not updated when the occupant leaves the chat room (i,e when the presence type is "unavailable")
Added the missing line to update the occupant presence within the updated method
//**_Missing Line_*
[occupant updateWithPresence:presence];
//**_Missing Line_*
In the method mentioned below, the presence of XMPPRoomOccupantMemoryStorageObject is not updated when the occupant leaves the chat room (i,e when the presence type is "unavailable")
Class: XMPPRoomMemoryStorage.m Method: - (void)handlePresence:(XMPPPresence )presence room:(XMPPRoom )room { }
Added the missing line to update the occupant presence within the updated method //**_Missing Line_* [occupant updateWithPresence:presence]; //**_Missing Line_*
Updated method: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
pragma mark XMPPRoomStorage Protocol
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
(void)handlePresence:(XMPPPresence )presence room:(XMPPRoom )room { XMPPLogTrace(); AssertParentQueue();
XMPPJID *from = [presence from];
if ([[presence type] isEqualToString:@"unavailable"]) { XMPPRoomOccupantMemoryStorageObject occupant = occupantsDict[from]; if (occupant) { // Occupant did leave - remove //*Missing Line*** [occupant updateWithPresence:presence]; //**Missing Line***
} else { XMPPRoomOccupantMemoryStorageObject *occupant = occupantsDict[from]; if (occupant == nil) { // Occupant did join - add
} }
Please let me know if the update is valid or not.