Need help on MucModule registration (#143)
Unknown opened 4 years ago

I'm trying to use MucModuleas per the documentation. However, it seems the current version now needs a DefaultRoomsManagerand that also needs an implementation for RoomStore protocol

Need help on how to properly register MucModule. Also, isn't tigase-swift should implement the RoomStoreinstead by the user?

Unknown commented 4 years ago

Implementation of RoomStore is not provided as many different types of storage may be use, ie. in memory, database, core data, etc. It is up to the use to choose correct storage and implement support for it. That is also why RoomStore protocol was created in the first place.

Unknown commented 4 years ago

All what implementation of RoomStore needs to do is to keep a reference of a Room (create it if asked) and return it when needed.

Also, another class extending Room may be used to store additional data.

Unknown commented 4 years ago

That makes sense. Closing this. Thank you

Unknown commented 4 years ago

@hantu85 quick clarification, if I understand correctly, tigase-swift doesn't have the ability to create the room by sending raw XML commands to XMPP server. It seems I need to implement the logic that will talk to my XMPP server to actually create the room.

Why is that I can see code for deleting the room

let query = Element(name: "query", xmlns: "http://jabber.org/protocol/muc#owner");
query.addChild(Element(name: "destroy"));

But I don't see one which instructs the XMPP server to create one (I think the user needs to implement it too). Is my understanding correct?

Unknown commented 4 years ago

Room creation is identical to joining the room and most of the servers will create a room which you want to join if it does not exist. If there room was created then you should receive a status code in the response marking that this is a new room.

That is why there is no point in having a code to create a room.

issue 1 of 1
Issue Votes (0)
Watchers (0)
Reference
tigase/_libraries/Martin#143
Please wait...
Page is in error, reload to recover