Fix left pane draft display and GV2 typing indicators

This commit is contained in:
Scott Nonnenberg 2020-11-03 16:16:20 -08:00 committed by GitHub
parent ab89c6c704
commit 18c71b291c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 58 additions and 31 deletions

View file

@ -21,7 +21,6 @@ import Crypto from './Crypto';
import {
base64ToArrayBuffer,
concatenateBytes,
fromEncodedBinaryToArrayBuffer,
getZeroes,
hexToArrayBuffer,
} from '../Crypto';
@ -982,7 +981,7 @@ export default class MessageSender {
async sendTypingMessage(
options: {
recipientId?: string;
groupId?: string;
groupId?: ArrayBuffer;
groupMembers: Array<string>;
isTyping: boolean;
timestamp?: number;
@ -1007,15 +1006,12 @@ export default class MessageSender {
const recipients = (groupId
? without(groupMembers, myNumber, myUuid)
: [recipientId]) as Array<string>;
const groupIdBuffer = groupId
? fromEncodedBinaryToArrayBuffer(groupId)
: null;
const action = isTyping ? ACTION_ENUM.STARTED : ACTION_ENUM.STOPPED;
const finalTimestamp = timestamp || Date.now();
const typingMessage = new window.textsecure.protobuf.TypingMessage();
typingMessage.groupId = groupIdBuffer;
typingMessage.groupId = groupId || null;
typingMessage.action = action;
typingMessage.timestamp = finalTimestamp;