prose-im / prose-app-web

Prose Web application. XMPP client for team messaging.
https://prose.org/downloads
Mozilla Public License 2.0
19 stars 2 forks source link

Use availability embedded in ParticipantInfo #28

Closed nesium closed 5 months ago

nesium commented 6 months ago

There are a couple of changes in the latest core lib: https://gist.github.com/nesium/f1c21dfb0d345b8c223017f418343a4e/revisions

members and occupants in Room have been merged into a single property participants (I've already changed that here) which is an array of ParticipantInfos.

Most importantly ParticipantInfo::jid is optional to honor the fact that MUC rooms can be anonymous and we might not know the real JID of a participant.

export class ParticipantInfo {
  free(): void;

  readonly affiliation: number;
  readonly availability: number;
  readonly isSelf: boolean;
  readonly jid: JID | undefined;
  readonly name: string;
}

isSelf might be handy for displaying purposes, but affiliation should probably be ignored until we have figured out our permissions system.

Also destroyRoom is now public on ProseClient

* Destroys the room identified by `room_jid`.
* @param {JID} room_jid
* @returns {Promise<void>}
*/
  destroyRoom(room_jid: JID): Promise<void>;
/**

There's also a new event handler roomParticipantsChanged that is called when the list of participants of a room is changed in some way (user joins/is kicked, etc.)

valeriansaliou commented 5 months ago

Upon calling destroyRoom I'm getting the following error:

[ERROR] Failed deleting channel Error: Room is already connected (org.prose.channel.viegfr7m@groups.prose.org.local).

Could the destroyRoom method be adjusted so that the room is left before it gets destroyed, so that the implementor doesn't have to handle the complexity of leaving before destroying? (and complexity of failure recovery if room is left but then removal fails, then we'd be left in a dangling state).

Other than this error, it's been implemented.

valeriansaliou commented 5 months ago

Other than that:

Blocking issues:

@nesium input needed on those blocking issues.

nesium commented 5 months ago

A couple of things went wrong here:

valeriansaliou commented 5 months ago

Thanks, bumped the core client library and it's now working.

Oops on the join() call, this was a typo. I tested with destroyRoom() right before refactoring to the current state, the error was there.

It's now working, thanks!