@@ -1124,15 +1124,16 @@ internal static async Task<List<SignalConversation>> InsertOrUpdateGroups(IList<
1124
1124
dbGroup = group ;
1125
1125
ctx . Groups . Add ( dbGroup ) ;
1126
1126
}
1127
+ refreshedGroups . Add ( dbGroup ) ;
1127
1128
foreach ( var member in members )
1128
1129
{
1129
- ( var contact , var notify ) = GetOrCreateContact ( ctx , member , 0 ) ;
1130
+ ( var contact , var createdNew ) = GetOrCreateContact ( ctx , member , 0 ) ;
1130
1131
dbGroup . GroupMemberships . Add ( new GroupMembership ( )
1131
1132
{
1132
1133
Contact = contact ,
1133
1134
Group = dbGroup
1134
1135
} ) ;
1135
- if ( notify )
1136
+ if ( createdNew )
1136
1137
{
1137
1138
newContacts . Add ( contact ) ;
1138
1139
}
@@ -1153,7 +1154,7 @@ internal static async Task<List<SignalConversation>> InsertOrUpdateGroups(IList<
1153
1154
return refreshedGroups ;
1154
1155
}
1155
1156
1156
- internal static List < SignalConversation > InsertOrUpdateContacts ( IList < SignalContact > contacts )
1157
+ internal static IList < SignalConversation > InsertOrUpdateContacts ( IList < SignalContact > contacts )
1157
1158
{
1158
1159
List < SignalConversation > refreshedContacts = new List < SignalConversation > ( ) ;
1159
1160
lock ( DBLock )
@@ -1351,24 +1352,25 @@ public static List<SignalContact> GetAllContactsLocked()
1351
1352
}
1352
1353
}
1353
1354
1354
- public static async Task < SignalContact > GetOrCreateContactLocked ( string username , long timestamp , bool notify = true )
1355
+ public static async Task < SignalContact > GetOrCreateContactLocked ( string username , long timestamp )
1355
1356
{
1356
1357
SignalContact contact ;
1358
+ bool createdNew ;
1357
1359
lock ( DBLock )
1358
1360
{
1359
1361
using ( var ctx = new SignalDBContext ( ) )
1360
1362
{
1361
- ( contact , notify ) = GetOrCreateContact ( ctx , username , timestamp , notify ) ;
1363
+ ( contact , createdNew ) = GetOrCreateContact ( ctx , username , timestamp ) ;
1362
1364
}
1363
1365
}
1364
- if ( notify )
1366
+ if ( createdNew )
1365
1367
{
1366
1368
await SignalLibHandle . Instance . DispatchAddOrUpdateConversation ( contact , null ) ;
1367
1369
}
1368
1370
return contact ;
1369
1371
}
1370
1372
1371
- private static ( SignalContact contact , bool notify ) GetOrCreateContact ( SignalDBContext ctx , string username , long timestamp , bool notify = true )
1373
+ private static ( SignalContact contact , bool createdNew ) GetOrCreateContact ( SignalDBContext ctx , string username , long timestamp )
1372
1374
{
1373
1375
bool createdNew = false ;
1374
1376
SignalContact contact = contact = ctx . Contacts
@@ -1382,13 +1384,13 @@ private static (SignalContact contact, bool notify) GetOrCreateContact(SignalDBC
1382
1384
ThreadDisplayName = username ,
1383
1385
CanReceive = true ,
1384
1386
LastActiveTimestamp = timestamp ,
1385
- Color = null //Utils.CalculateDefaultColor(username)
1387
+ Color = null
1386
1388
} ;
1387
1389
ctx . Contacts . Add ( contact ) ;
1388
1390
ctx . SaveChanges ( ) ;
1389
1391
createdNew = true ;
1390
1392
}
1391
- return ( contact , createdNew && notify ) ;
1393
+ return ( contact , createdNew ) ;
1392
1394
}
1393
1395
1394
1396
public static void InsertOrUpdateConversationLocked ( SignalConversation conversation )
0 commit comments