prose-im / prose-app-web

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

Rooms-related UI #13

Closed nesium closed 5 months ago

nesium commented 10 months ago

Relevant notes from the PR:

To create a new room Client provides createGroup, createPrivateChannel, createPublicChannel and joinRoom respectively. These return the created room and do not trigger a RoomsChanged event, so that the app can insert the new room into its list of rooms and selected it.

Note: I couldn't find a way to accept an array of JIDs through the Wasm binding, so unfortunately you'll need to pass an array of strings for the time being.


^1:

export class ProseClient {
  /**
  * Creates the private channel and returns the created `Room`.
  * @param {string} channel_name
  * @returns {Promise<any>}
  */
    createPrivateChannel(channel_name: string): Promise<any>;
}

^2:

export class ProseClient {
  /**
  * Creates the public channel or joins it if one with the same name already exists and
  * returns the `Room`.
  * @param {string} channel_name
  * @returns {Promise<any>}
  */
    createPublicChannel(channel_name: string): Promise<any>;
}

^3:

export class ProseClient {
  /**
  * Creates the group or joins it if it already exists and returns the `Room`.
  * Sends invites to all participants if the group was created.
  * Pass a String[] as participants where each string is a valid BareJid.
  * @param {Array<any>} participants
  * @returns {Promise<any>}
  */
    createGroup(participants: Array<any>): Promise<any>;

  /**
  * @returns {Promise<Contact[]>}
  */
    loadContacts(): Promise<Contact[]>;
}

^4:

export class ProseClient {
  /**
  * @returns {Promise<Channel[]>}
  */
    loadPublicChannels(): Promise<Channel[]>;
}

/**
* Joins and returns the room identified by `Room`.
* @param {JID} room_jid
* @param {string | undefined} password
* @returns {Promise<any>}
*/
  joinRoom(room_jid: JID, password?: string): Promise<any>;

^5:

export interface RoomChannel {
    /// Pass an array of valid BareJid strings.
    inviteUsers(users: string[]): Promise<void>;
}

^6:

export interface RoomGroup extends RoomBase, RoomMUC {
  type: RoomType.Group;

  /// Resends invites to its members. Can be useful if someone accidentally rejected the invite or 
  /// deleted their bookmark.
  resendInvitesToMembers(): Promise<void>;
}

^7: Adding a member to a group should actually create a new group with the same participants from the existing group plus the new participants. In the future we should support copying a selected number of messages from the old group to the new group.


Support creating a room and inviting users (might share similarities with #11). Related core-client-ticket

nesium commented 8 months ago

I'm going to repeat this here. This should probably go as a ticket in a repository with server code which we don't have yet:

Public Rooms and users from foreign servers

In the current implementation I've configured Public Rooms as open MUC rooms, meaning everyone can join. We've talked about this briefly that this would allow users from foreign servers to join as well, which is not desireable. Another option could be to configure these as member-only rooms similar to Groups and let the user try to register themselves. The server MUC module could then i.e. automatically grant the request for users from the same domain and forward the request to an admin for users from a foreign domain.

valeriansaliou commented 8 months ago

I'm taking this on for this weekend & next week. Will be soon available, I'll follow up there as I progress on sub-tasks, thank you for all the details.

valeriansaliou commented 5 months ago

Only remaining task here is the browsing of public channels. I’ll implement a dedicated full screen UI for that, which will be available in the Spotlight section of the app.

valeriansaliou commented 5 months ago

Closing this in favor of #36, which is the last task remaining from this issue.