Skip to content

Commit

Permalink
Fix crash updating call status
Browse files Browse the repository at this point in the history
  • Loading branch information
valldrac committed Nov 8, 2023
1 parent 9354d4c commit 040f742
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ class CallTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTabl
.run()
.readToSingleObject(Call.Deserializer)

if (call != null) {
if (call?.messageId != null) {
Log.i(TAG, "Updated call: $callId event: $event")

val unread = MessageTypes.isMissedCall(call.messageType)
val expiresIn = Recipient.resolved(call.peer).expiresInMillis

SignalDatabase.messages.updateCallLog(call.messageId!!, call.messageType, unread)
SignalDatabase.messages.updateCallLog(call.messageId, call.messageType, unread)

if (!unread && expiresIn > 0) {
val timestampOrNow = timestamp ?: System.currentTimeMillis()
Expand Down

0 comments on commit 040f742

Please sign in to comment.