Typing Indicators

This commit is contained in:
Scott Nonnenberg 2018-11-14 11:10:32 -08:00
parent 99252702e1
commit 79a861a870
23 changed files with 906 additions and 121 deletions

View file

@ -55,6 +55,9 @@ const {
const {
TimerNotification,
} = require('../../ts/components/conversation/TimerNotification');
const {
TypingBubble,
} = require('../../ts/components/conversation/TypingBubble');
const {
VerificationNotification,
} = require('../../ts/components/conversation/VerificationNotification');
@ -191,6 +194,7 @@ exports.setup = (options = {}) => {
Types: {
Message: MediaGalleryMessage,
},
TypingBubble,
VerificationNotification,
};

View file

@ -695,6 +695,7 @@ function initialize({ url, cdnUrl, certificateAuthority, proxyUrl }) {
messageArray,
timestamp,
silent,
online,
{ accessKey } = {}
) {
const jsonData = { messages: messageArray, timestamp };
@ -702,6 +703,9 @@ function initialize({ url, cdnUrl, certificateAuthority, proxyUrl }) {
if (silent) {
jsonData.silent = true;
}
if (online) {
jsonData.online = true;
}
return _ajax({
call: 'messages',
@ -714,12 +718,21 @@ function initialize({ url, cdnUrl, certificateAuthority, proxyUrl }) {
});
}
function sendMessages(destination, messageArray, timestamp, silent) {
function sendMessages(
destination,
messageArray,
timestamp,
silent,
online
) {
const jsonData = { messages: messageArray, timestamp };
if (silent) {
jsonData.silent = true;
}
if (online) {
jsonData.online = true;
}
return _ajax({
call: 'messages',