Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ChatRoom' and 'SendChatMessage' #765

Closed
symphony-jean-michael opened this issue Jun 27, 2022 · 1 comment · Fixed by #994
Closed

'ChatRoom' and 'SendChatMessage' #765

symphony-jean-michael opened this issue Jun 27, 2022 · 1 comment · Fixed by #994
Labels
Context Data & Intents Contexts & Intents Discussion Group enhancement New feature or request
Milestone

Comments

@symphony-jean-michael
Copy link
Contributor

symphony-jean-michael commented Jun 27, 2022

Enhancement Request

Use Case:

This proposal covers two connected use cases:

  • update the 'StartChat' intent to return a reference to the new created Chat room (ChatRoom)
  • support the possibility to send messages in existing chats (New intent 'SendChatMessage')

Description

The 'StartChat' intent has been modified (see PR #620) to be able to create new chats.
Since the latest version of FDC3, it is now possible that an intent returns data. So, this ticket is to continue the discussion/modification in order to implement the following changes:

  • Update the StartChat intent to return a ChatRoom
  • Add new intent 'SendChatMessage' that uses the ChatRoom

A request to add the new intent 'SendChatMessage' had already been proposed in the issue: #574 (But there was no PR yet because the standard did not yet allow to return a result)
This ticket repeats the elements already presented and makes some modifications on the id & appName.

ChatRoom:

/**
 * Context returned by StartChat and SendChatMessage
 */
interface ChatRoom {
    type: "fdc3.chat.room";
    providerName: string // Name of the application that created the room / direct chat
    roomId: string // ID or the created room / direct chat
    uri?: string;   // Unique Universal URL to access to the chat room (Should we name the field 'id' or 'uri'?)
    name?: string; // Name of the chat room (This is for information purposes only as the room name may change in the future)
}

Example:

const intentResolution = await fdc3.raiseIntent("StartChat", context);

const chatRoom = intentResolution.getResult():

/* // The chatRoom will be like:
  chatRoom = {
    type: "fdc3.chat.room",
    providerName: "Symphony",
    roomId: "j75xqXy25NBOdacUI3FNBH",
    uri: "http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA",
    name: 'My new room'
  };
*/

We suggest adding an universal url for the uri. (It could be opened from a browser, a mobile app, etc...)

SendChatMessage:
(Related ticket: #574)

// Start a chat
const intentResolution = await fdc3.raiseIntent("StartChat", context);
const chatRoom = intentResolution.getResult();

//Some time later

let chatMessage: ChatMessage = {
    type: "fdc3.chat.message",
    chatRoom,
    message: "Another message to send in the room"
}

await fdc3.raiseIntent("SendChatMessage", context, intentResolution.source);
@symphony-jean-michael symphony-jean-michael added the enhancement New feature or request label Jun 27, 2022
@Yannick-Malins
Copy link
Contributor

We suggest using a universal url for the uri. (It could be opened from a browser, a mobile app, etc...)

this has the advantage that if there is no app registered for this intent, the fdc3 bus could suggest to open the associated URI in web browser

@mistryvinay mistryvinay added the Context Data & Intents Contexts & Intents Discussion Group label Jun 27, 2022
@symphony-jean-michael symphony-jean-michael changed the title [Draft] 'ChatRoomRef' and 'SendChatMessage' 'ChatRoomRef' and 'SendChatMessage' Jun 28, 2022
@symphony-jean-michael symphony-jean-michael changed the title 'ChatRoomRef' and 'SendChatMessage' 'ChatRoom' and 'SendChatMessage' Aug 3, 2022
@kriswest kriswest added this to the 2.1-candidates milestone Aug 30, 2022
@kriswest kriswest modified the milestones: 2.1-candidates, 2.1 Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment