You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| fetchMessages (1) |`{ room, options }`| A user has scrolled on top to load more messages |
274
+
| sendMessage |`{ roomId, content, file (4), replyMessage (5) }`| A user has sent a message |
275
+
| editMessage |`{ roomId, messageId, newContent, file (4), replyMessage (5) }`| A user has edited a message |
276
+
| deleteMessage |`{ roomId, messageId }`| A user has deleted a message |
277
+
| openFile |`{ message }`| A user has clicked to view or download a file |
278
+
| addRoom | - | A user clicks on the plus icon next to searchbar |
279
+
| menuActionHandler (2) |`{ roomId, action }`| A user clicks on the vertical dots icon inside a room |
280
+
| messageActionHandler (3) |`{ roomId, action }`| A user clicks on the dropdown icon inside a message |
241
281
242
282
(1) `fetchMessages` should be a method implementing a pagination system. Its purpose is to load older messages of a conversation when the user scroll on top
(3) All file params contain: `{ blob, localURL, name, size, type }`
301
+
(3) `messageActionHandler` is the result of the `messageActions` prop.<br>
302
+
When clicking a button from your `messageActions` array, `messageActionHandler` will give you the name of the button that was click.
303
+
Then you can do whatever you want with it. Ex:
304
+
305
+
```javascript
306
+
messageActionHandler({ roomId, action }) {
307
+
switch (action.name) {
308
+
case'addMessageToFavorite':
309
+
// call a method to add a message to the favorite list
310
+
case'shareMessage':
311
+
// call a method to share the message with another user
312
+
}
313
+
}
314
+
```
315
+
316
+
(4) All file params contain: `{ blob, localURL, name, size, type }`
262
317
263
-
(4) `replyMessage` object is available when the user replied to another message by clicking the corresponding icon, and contains the message information that was clicked
318
+
(5) `replyMessage` object is available when the user replied to another message by clicking the corresponding icon, and contains the message information that was clicked
0 commit comments