Event: "typing:change"
When another user in the system starts or stops typing, the typing:change
event will be emitted. The current user will only be notified of this event if they have at least one 1-on-1 or group conversation with this other user.
Properties
Property | Type | Description |
---|---|---|
isTyping | boolean | true if typing started, false if typing stopped |
contextId | string | The ID of the context in which the typing is taking place: can be either a Group ID, an Organization ID, or null if the typing is applicable globally |
contextType | string | The type of context in which the typing is taking place: can be either client.enums.typingContext.GROUP if the typing is taking place in a group, client.enums.typingContext.ORGANIZATION if the typing is taking place in a p2p conversation within a specific organization, or client.enums.typingContext.GLOBAL if the typing is applicable globally to all p2p conversations with this user |
userId | string | ID of User that is typing |
Examples
client.on('typing:change', function onTypingChange(e) {console.log(e.userId,(e.isTyping ? 'started' : 'stopped') + ' typing','with a contextId of ' + e.contextId);});