File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -654,6 +654,20 @@ public static void Migrate()
654
654
655
655
#region Messages
656
656
657
+ public static void FailAllPendingMessages ( )
658
+ {
659
+ lock ( DBLock )
660
+ {
661
+ using ( var ctx = new SignalDBContext ( ) )
662
+ {
663
+ var messages = ctx . Messages
664
+ . Where ( m => m . Direction == SignalMessageDirection . Outgoing && m . Status == SignalMessageStatus . Pending ) . ToList ( ) ;
665
+ messages . ForEach ( m => m . Status = SignalMessageStatus . Failed_Unknown ) ;
666
+ ctx . SaveChanges ( ) ;
667
+ }
668
+ }
669
+ }
670
+
657
671
public static LinkedList < SignalMessage > InsertIdentityChangedMessages ( string number )
658
672
{
659
673
long now = Util . CurrentTimeMillis ( ) ;
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ public async Task Init()
108
108
{
109
109
await Task . Run ( async ( ) =>
110
110
{
111
+ SignalDBContext . FailAllPendingMessages ( ) ;
111
112
List < SignalContact > contacts = SignalDBContext . GetAllContactsLocked ( ) ;
112
113
List < SignalGroup > groups = SignalDBContext . GetAllGroupsLocked ( ) ;
113
114
await Windows . ApplicationModel . Core . CoreApplication . MainView . CoreWindow . Dispatcher . RunAsync ( Windows . UI . Core . CoreDispatcherPriority . Normal , ( ) =>
You can’t perform that action at this time.
0 commit comments