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

'View Chat' intent #767

Closed
symphony-jean-michael opened this issue Jun 28, 2022 · 0 comments · Fixed by #994
Closed

'View Chat' intent #767

symphony-jean-michael opened this issue Jun 28, 2022 · 0 comments · 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 28, 2022

Enhancement Request

Use Case:

Users may want to open an existing chat room.

Intents

ViewChat

The proposal is to support a new intent (ViewChat) to open an existing chat room. (The chat will be displayed)

Intent name: ViewChat
Display Name: View Chat

Contexts

This intent could take as input types:

  • either a fdc3.chat.room (Created and returned by the 'StartChat' intent)
  • either a fdc3.contact: It will open the direct chat where there is the current user and the contact
  • either a fdc3.contactList: It will open the room where there is the current user and the listed contacts. Contact List may need to display search results if there are multiple matches.

This intent could return as output:

  • If the chat doesn't exist, will display a modal to create a chat
  • if the chat gets created, return its ChatRoom context
  • if none is created return void (rather than throw an error, which will stop the IntentResolution returning)
Context: ChatRoom

('ChatRoom' related ticket: #765)

Property Type Required Example Value
type string Yes 'fdc3.chat.room'
providerName string Yes Symphony
roomId string Yes j75xqXy25NBOdacUI3FNBH
uri string No 'http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA'
name string No 'My room'
Example
const chatRoom = {
    type: 'fdc3.chat.room',
    providerName: "Symphony",
    roomId: "j75xqXy25NBOdacUI3FNBH"
}

const intentResolution = await fdc3.raiseIntent('ViewChat', chatRoom);

const chatRoom = intentResolution.getResult(): // A chatRoom will be returned as context if the room was found
Context: Contact
Property Type Required Example Value
type string Yes 'fdc3.contact'
name string No 'Jane Doe'
id.email string Yes 'jane@mail.com'
Example
const contact = {
    type: 'fdc3.contact',
    name: 'Jane Doe',
    id: {
        email: 'jane@mail.com'
    }
}


const intentResolution = await fdc3.raiseIntent('ViewChat', contact);

const chatRoom = intentResolution.getResult(): // A chatRoom will be returned as context if the direct chat was found
Context: ContactList
Property Type Required Example Value
type string Yes 'fdc3.contactList'
contacts Contact[] Yes '[contact1, contact2]'
Example
const contacts = {
    type: 'fdc3.contactList',
    contacts: [
        {
            type: 'fdc3.contact',
            name: 'Jane Doe',
            id: {
                email: 'jane.doe@mail.com'
            }
        },
        {
            type: 'fdc3.contact',
            name: 'John Doe',
            id: {
                email: 'john.doe@mail.com'
            }
        },
    ]
}


const intentResolution = await fdc3.raiseIntent('ViewChat', contacts);

const chatRoom = intentResolution.getResult(): // A chatRoom will be returned as context if the room was found

Additional Information

No room found

In case the ViewChat can't open the room:

  • Invalid ChatRoom identifier
  • Unknown contact email
  • No room exists with the listed contact(s)
    Then no room will be displayed, and void will be returned. (It will be translated as 'undefined' in Typescript)
Example:
const chatRoom = {
    type: "fdc3.chat.room",
    providerName: "Symphony",
    roomId: "A_INVALID_REF"
}

const intentResolution = await fdc3.raiseIntent('ViewChat', chatRoom);

const context = intentResolution.getResult(): // The chat room was not found, and none was created
@symphony-jean-michael symphony-jean-michael added Context Data & Intents Contexts & Intents Discussion Group enhancement New feature or request labels Jun 28, 2022
@symphony-jean-michael symphony-jean-michael changed the title [Draft] 'View Chat' intent 'View Chat' intent Jul 4, 2022
@kriswest kriswest added this to the 2.1-candidates milestone Jul 28, 2022
@mistryvinay mistryvinay linked a pull request Oct 4, 2022 that will close this issue
@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
Labels
Context Data & Intents Contexts & Intents Discussion Group enhancement New feature or request
Projects
None yet
2 participants