Move file
This commit is contained in:
parent
1d2b3719f9
commit
1a77ba51cf
|
@ -5,9 +5,9 @@
|
|||
<key>BuildDetails</key>
|
||||
<dict>
|
||||
<key>CarthageVersion</key>
|
||||
<string>0.34.0</string>
|
||||
<string>0.33.0</string>
|
||||
<key>OSXVersion</key>
|
||||
<string>10.15.2</string>
|
||||
<string>10.15.3</string>
|
||||
<key>WebRTCCommit</key>
|
||||
<string>1445d719bf05280270e9f77576f80f973fd847f8 M73</string>
|
||||
</dict>
|
||||
|
|
|
@ -165,9 +165,9 @@ final class DeviceLinkingModal : Modal, DeviceLinkingSessionDelegate {
|
|||
let linkingAuthorizationMessage = DeviceLinkingUtilities.getLinkingAuthorizationMessage(for: deviceLink)
|
||||
ThreadUtil.enqueue(linkingAuthorizationMessage)
|
||||
SSKEnvironment.shared.messageSender.send(linkingAuthorizationMessage, success: {
|
||||
let _ = [SSKEnvironment.shared.syncManager.syncAllContacts(),
|
||||
SSKEnvironment.shared.syncManager.syncAllGroups(),
|
||||
SSKEnvironment.shared.syncManager.syncAllOpenGroups()]
|
||||
SSKEnvironment.shared.syncManager.syncAllContacts()
|
||||
SSKEnvironment.shared.syncManager.syncAllGroups()
|
||||
SSKEnvironment.shared.syncManager.syncAllOpenGroups()
|
||||
}) { _ in
|
||||
print("[Loki] Failed to send device link authorization message.")
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#import <SignalServiceKit/OWSSyncConfigurationMessage.h>
|
||||
#import <SignalServiceKit/OWSSyncContactsMessage.h>
|
||||
#import <SignalServiceKit/OWSSyncGroupsMessage.h>
|
||||
#import <SignalServiceKit/OWSSyncOpenGroupsMessage.h>
|
||||
#import <SignalServiceKit/LKSyncOpenGroupsMessage.h>
|
||||
#import <SignalServiceKit/SSKEnvironment.h>
|
||||
#import <SignalServiceKit/SignalAccount.h>
|
||||
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
||||
|
@ -369,15 +369,15 @@ NSString *const kSyncManagerLastContactSyncKey = @"kTSStorageManagerOWSSyncManag
|
|||
|
||||
- (AnyPromise *)syncAllOpenGroups
|
||||
{
|
||||
OWSSyncOpenGroupsMessage *syncOpenGroupsMessage = [[OWSSyncOpenGroupsMessage alloc] init];
|
||||
LKSyncOpenGroupsMessage *syncOpenGroupsMessage = [[LKSyncOpenGroupsMessage alloc] init];
|
||||
AnyPromise *promise = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) {
|
||||
[self.messageSender sendMessage:syncOpenGroupsMessage
|
||||
success:^{
|
||||
OWSLogInfo(@"Successfully sent open groups syn message.");
|
||||
OWSLogInfo(@"Successfully sent open group sync message.");
|
||||
resolve(@(1));
|
||||
}
|
||||
failure:^(NSError *error) {
|
||||
OWSLogError(@"Failed to send open group sync message with error: %@.", error);
|
||||
OWSLogError(@"Failed to send open group sync message due to error: %@.", error);
|
||||
resolve(error);
|
||||
}];
|
||||
}];
|
||||
|
|
|
@ -321,11 +321,11 @@ message SyncMessage {
|
|||
optional AttachmentPointer blob = 1;
|
||||
optional bytes data = 101; // Loki
|
||||
}
|
||||
|
||||
|
||||
// Loki
|
||||
message OpenGroupDetails {
|
||||
optional string url = 1;
|
||||
optional uint64 channelId = 2;
|
||||
optional string url = 1;
|
||||
optional uint64 channelId = 2;
|
||||
}
|
||||
|
||||
message Blocked {
|
||||
|
|
|
@ -4,7 +4,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
@class LKPublicChat;
|
||||
|
||||
@interface OWSSyncOpenGroupsMessage : OWSOutgoingSyncMessage
|
||||
@interface LKSyncOpenGroupsMessage : OWSOutgoingSyncMessage
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#import "OWSSyncOpenGroupsMessage.h"
|
||||
#import "LKSyncOpenGroupsMessage.h"
|
||||
#import "OWSPrimaryStorage.h"
|
||||
#import <SignalServiceKit/SignalServiceKit-Swift.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSSyncOpenGroupsMessage
|
||||
@implementation LKSyncOpenGroupsMessage
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
|
@ -19,26 +19,24 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
- (nullable SSKProtoSyncMessageBuilder *)syncMessageBuilder
|
||||
{
|
||||
NSError *error;
|
||||
NSMutableArray<SSKProtoSyncMessageOpenGroups *> *sessionOpenGroups = @[].mutableCopy;
|
||||
NSMutableArray<SSKProtoSyncMessageOpenGroups *> *openGroups = @[].mutableCopy;
|
||||
__block NSDictionary<NSString *, LKPublicChat *> *publicChats;
|
||||
[OWSPrimaryStorage.sharedManager.dbReadConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
||||
publicChats = [LKDatabaseUtilities getAllPublicChats:transaction];
|
||||
}];
|
||||
for (LKPublicChat *openGroup in publicChats.allValues) {
|
||||
SSKProtoSyncMessageOpenGroupsBuilder *openGroupBuilder = [SSKProtoSyncMessageOpenGroups builder];
|
||||
[openGroupBuilder setUrl:openGroup.server];
|
||||
[openGroupBuilder setChannel:openGroup.channel];
|
||||
SSKProtoSyncMessageOpenGroups *_Nullable openGroupProto = [openGroupBuilder buildAndReturnError:&error];
|
||||
if (error || !openGroupProto) {
|
||||
OWSFailDebug(@"could not build protobuf: %@", error);
|
||||
SSKProtoSyncMessageOpenGroupsBuilder *openGroupMessageBuilder = [SSKProtoSyncMessageOpenGroups builder];
|
||||
[openGroupMessageBuilder setUrl:openGroup.server];
|
||||
[openGroupMessageBuilder setChannel:openGroup.channel];
|
||||
SSKProtoSyncMessageOpenGroups *_Nullable openGroupMessageProto = [openGroupMessageBuilder buildAndReturnError:&error];
|
||||
if (error || !openGroupMessageProto) {
|
||||
OWSFailDebug(@"Couldn't build protobuf due to error: %@", error);
|
||||
return nil;
|
||||
}
|
||||
[sessionOpenGroups addObject:openGroupProto];
|
||||
[openGroups addObject:openGroupMessageProto];
|
||||
}
|
||||
|
||||
SSKProtoSyncMessageBuilder *syncMessageBuilder = [SSKProtoSyncMessage builder];
|
||||
[syncMessageBuilder setOpenGroups:sessionOpenGroups];
|
||||
|
||||
[syncMessageBuilder setOpenGroups:openGroups];
|
||||
return syncMessageBuilder;
|
||||
}
|
||||
|
Loading…
Reference in New Issue