Update to RingRTC v2.17.2

This commit is contained in:
Jim Gustafson 2022-01-28 11:55:36 -08:00 committed by GitHub
parent bd41bdf3cb
commit ab9d33cf1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 73 additions and 45 deletions

View file

@ -163,7 +163,7 @@
"redux-ts-utils": "3.2.2", "redux-ts-utils": "3.2.2",
"reselect": "4.1.2", "reselect": "4.1.2",
"rimraf": "2.6.2", "rimraf": "2.6.2",
"ringrtc": "https://github.com/signalapp/signal-ringrtc-node.git#f25f900355bbd69821449a39ad88c5a1afdaaac3", "ringrtc": "https://github.com/signalapp/signal-ringrtc-node.git#f22009252bd3742f5b8a2761fe8f9c76a3bbc11d",
"rotating-file-stream": "2.1.5", "rotating-file-stream": "2.1.5",
"sanitize.css": "11.0.0", "sanitize.css": "11.0.0",
"semver": "5.4.1", "semver": "5.4.1",

View file

@ -3009,7 +3009,8 @@ export class ConversationModel extends window.Backbone
} }
async addCallHistory( async addCallHistory(
callHistoryDetails: CallHistoryDetailsType callHistoryDetails: CallHistoryDetailsType,
receivedAtCounter: number | undefined
): Promise<void> { ): Promise<void> {
let timestamp: number; let timestamp: number;
let unread: boolean; let unread: boolean;
@ -3038,7 +3039,8 @@ export class ConversationModel extends window.Backbone
conversationId: this.id, conversationId: this.id,
type: 'call-history', type: 'call-history',
sent_at: timestamp, sent_at: timestamp,
received_at: window.Signal.Util.incrementMessageCounter(), received_at:
receivedAtCounter || window.Signal.Util.incrementMessageCounter(),
received_at_ms: timestamp, received_at_ms: timestamp,
readStatus: unread ? ReadStatus.Unread : ReadStatus.Read, readStatus: unread ? ReadStatus.Unread : ReadStatus.Read,
callHistoryDetails: detailsToSave, callHistoryDetails: detailsToSave,
@ -3081,12 +3083,15 @@ export class ConversationModel extends window.Backbone
return false; return false;
} }
await this.addCallHistory({ await this.addCallHistory(
callMode: CallMode.Group, {
creatorUuid, callMode: CallMode.Group,
eraId, creatorUuid,
startedTime: Date.now(), eraId,
}); startedTime: Date.now(),
},
undefined
);
return true; return true;
} }

View file

@ -1483,6 +1483,7 @@ export class CallingClass {
remoteDeviceId, remoteDeviceId,
this.localDeviceId, this.localDeviceId,
messageAgeSec, messageAgeSec,
envelope.receivedAtCounter,
protoToCallingMessage(callingMessage), protoToCallingMessage(callingMessage),
Buffer.from(senderIdentityKey), Buffer.from(senderIdentityKey),
Buffer.from(receiverIdentityKey) Buffer.from(receiverIdentityKey)
@ -1763,7 +1764,9 @@ export class CallingClass {
private handleAutoEndedIncomingCallRequest( private handleAutoEndedIncomingCallRequest(
remoteUserId: UserId, remoteUserId: UserId,
reason: CallEndedReason, reason: CallEndedReason,
ageInSeconds: number ageInSeconds: number,
wasVideoCall: boolean,
receivedAtCounter: number | undefined
) { ) {
const conversation = window.ConversationController.get(remoteUserId); const conversation = window.ConversationController.get(remoteUserId);
if (!conversation) { if (!conversation) {
@ -1781,7 +1784,9 @@ export class CallingClass {
this.addCallHistoryForAutoEndedIncomingCall( this.addCallHistoryForAutoEndedIncomingCall(
conversation, conversation,
reason, reason,
endedTime endedTime,
wasVideoCall,
receivedAtCounter
); );
} }
@ -1975,14 +1980,17 @@ export class CallingClass {
acceptedTime = Date.now(); acceptedTime = Date.now();
} }
conversation.addCallHistory({ conversation.addCallHistory(
callMode: CallMode.Direct, {
wasIncoming: call.isIncoming, callMode: CallMode.Direct,
wasVideoCall: call.isVideoCall, wasIncoming: call.isIncoming,
wasDeclined, wasVideoCall: call.isVideoCall,
acceptedTime, wasDeclined,
endedTime: Date.now(), acceptedTime,
}); endedTime: Date.now(),
},
undefined
);
} }
private addCallHistoryForFailedIncomingCall( private addCallHistoryForFailedIncomingCall(
@ -1990,33 +1998,48 @@ export class CallingClass {
wasVideoCall: boolean, wasVideoCall: boolean,
timestamp: number timestamp: number
) { ) {
conversation.addCallHistory({ conversation.addCallHistory(
callMode: CallMode.Direct, {
wasIncoming: true, callMode: CallMode.Direct,
wasVideoCall, wasIncoming: true,
// Since the user didn't decline, make sure it shows up as a missed call instead wasVideoCall,
wasDeclined: false, // Since the user didn't decline, make sure it shows up as a missed call instead
acceptedTime: undefined, wasDeclined: false,
endedTime: timestamp, acceptedTime: undefined,
}); endedTime: timestamp,
},
undefined
);
} }
private addCallHistoryForAutoEndedIncomingCall( private addCallHistoryForAutoEndedIncomingCall(
conversation: ConversationModel, conversation: ConversationModel,
_reason: CallEndedReason, reason: CallEndedReason,
endedTime: number endedTime: number,
wasVideoCall: boolean,
receivedAtCounter: number | undefined
) { ) {
conversation.addCallHistory({ let wasDeclined = false;
callMode: CallMode.Direct, let acceptedTime;
wasIncoming: true,
// We don't actually know, but it doesn't seem that important in this case, if (reason === CallEndedReason.AcceptedOnAnotherDevice) {
// but we could maybe plumb this info through RingRTC acceptedTime = endedTime;
wasVideoCall: false, } else if (reason === CallEndedReason.DeclinedOnAnotherDevice) {
// Since the user didn't decline, make sure it shows up as a missed call instead wasDeclined = true;
wasDeclined: false, }
acceptedTime: undefined, // Otherwise it will show up as a missed call.
endedTime,
}); conversation.addCallHistory(
{
callMode: CallMode.Direct,
wasIncoming: true,
wasVideoCall,
wasDeclined,
acceptedTime,
endedTime,
},
receivedAtCounter
);
} }
public async updateCallHistoryForGroupCall( public async updateCallHistoryForGroupCall(

View file

@ -75,7 +75,7 @@ export type ActiveCallType = ActiveDirectCallType | ActiveGroupCallType;
// Must be kept in sync with RingRTC.CallState // Must be kept in sync with RingRTC.CallState
export enum CallState { export enum CallState {
Prering = 'init', Prering = 'idle',
Ringing = 'ringing', Ringing = 'ringing',
Accepted = 'connected', Accepted = 'connected',
Reconnecting = 'connecting', Reconnecting = 'connecting',

View file

@ -13000,9 +13000,9 @@ rimraf@^3.0.0, rimraf@^3.0.2:
dependencies: dependencies:
glob "^7.1.3" glob "^7.1.3"
"ringrtc@https://github.com/signalapp/signal-ringrtc-node.git#f25f900355bbd69821449a39ad88c5a1afdaaac3": "ringrtc@https://github.com/signalapp/signal-ringrtc-node.git#f22009252bd3742f5b8a2761fe8f9c76a3bbc11d":
version "2.17.0" version "2.17.2"
resolved "https://github.com/signalapp/signal-ringrtc-node.git#f25f900355bbd69821449a39ad88c5a1afdaaac3" resolved "https://github.com/signalapp/signal-ringrtc-node.git#f22009252bd3742f5b8a2761fe8f9c76a3bbc11d"
ripemd160@^2.0.0, ripemd160@^2.0.1: ripemd160@^2.0.0, ripemd160@^2.0.1:
version "2.0.1" version "2.0.1"