Skip to content

Commit

Permalink
Fix scheduled send in note to self with no linked devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
cody-signal authored and alex-signal committed Feb 6, 2023
1 parent 3b40b10 commit 67fb9d0
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ public static void sendStories(@NonNull final Context context,
recipient,
SendType.SIGNAL,
messageId,
jobDependencyIds);
jobDependencyIds,
false);
}

onMessageSent();
Expand Down Expand Up @@ -238,7 +239,7 @@ public static long send(final Context context,
SignalLocalMetrics.GroupMessageSend.cancel(metricId);
}

sendMessageInternal(context, recipient, sendType, messageId, Collections.emptyList());
sendMessageInternal(context, recipient, sendType, messageId, Collections.emptyList(), message.getScheduledDate() > 0);
onMessageSent();
threadTable.update(allocatedThreadId, true);

Expand Down Expand Up @@ -275,7 +276,7 @@ public static long sendPushWithPreUploadedMedia(final Context context,

attachmentDatabase.updateMessageId(attachmentIds, messageId, message.getStoryType().isStory());

sendMessageInternal(context, recipient, SendType.SIGNAL, messageId, jobIds);
sendMessageInternal(context, recipient, SendType.SIGNAL, messageId, jobIds, false);
onMessageSent();
threadTable.update(allocatedThreadId, true);

Expand Down Expand Up @@ -503,7 +504,7 @@ public static void resend(Context context, MessageRecord messageRecord) {
sendType = SendType.SIGNAL;
}

sendMessageInternal(context, recipient, sendType, messageId, Collections.emptyList());
sendMessageInternal(context, recipient, sendType, messageId, Collections.emptyList(), false);

onMessageSent();
}
Expand All @@ -519,9 +520,14 @@ public static void onMessageSent() {
return outgoingMessage;
}

private static void sendMessageInternal(Context context, Recipient recipient, SendType sendType, long messageId, @NonNull Collection<String> uploadJobIds)
private static void sendMessageInternal(Context context,
Recipient recipient,
SendType sendType,
long messageId,
@NonNull Collection<String> uploadJobIds,
boolean isScheduledSend)
{
if (isLocalSelfSend(context, recipient, sendType)) {
if (isLocalSelfSend(context, recipient, sendType) && !isScheduledSend) {
sendLocalMediaSelf(context, messageId);
} else if (recipient.isPushGroup()) {
sendGroupPush(context, recipient, messageId, Collections.emptySet(), uploadJobIds);
Expand Down

0 comments on commit 67fb9d0

Please sign in to comment.