mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.4 KiB
Matlab
61 lines
1.4 KiB
Matlab
8 years ago
|
//
|
||
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "OWSSyncGroupsRequestMessage.h"
|
||
|
#import "NSDate+millisecondTimeStamp.h"
|
||
|
#import "OWSSignalServiceProtos.pb.h"
|
||
|
|
||
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
|
@interface OWSSyncGroupsRequestMessage ()
|
||
|
|
||
|
@property (nonatomic) NSData *groupId;
|
||
|
|
||
|
@end
|
||
|
|
||
|
#pragma mark -
|
||
|
|
||
|
@implementation OWSSyncGroupsRequestMessage
|
||
|
|
||
|
- (instancetype)initWithThread:(nullable TSThread *)thread groupId:(NSData *)groupId
|
||
|
{
|
||
|
self = [super initWithTimestamp:[NSDate ows_millisecondTimeStamp] inThread:thread];
|
||
|
if (!self) {
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
OWSAssert(groupId.length > 0);
|
||
|
_groupId = groupId;
|
||
|
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
- (void)saveWithTransaction:(YapDatabaseReadWriteTransaction *)transaction
|
||
|
{
|
||
|
// override superclass with no-op.
|
||
|
//
|
||
|
// There's no need to save this message, since it's not displayed to the user.
|
||
|
}
|
||
|
|
||
|
- (BOOL)shouldSyncTranscript
|
||
|
{
|
||
|
return NO;
|
||
|
}
|
||
|
|
||
|
- (OWSSignalServiceProtosDataMessageBuilder *)dataMessageBuilder
|
||
|
{
|
||
|
OWSSignalServiceProtosGroupContextBuilder *groupContextBuilder = [OWSSignalServiceProtosGroupContextBuilder new];
|
||
|
[groupContextBuilder setType:OWSSignalServiceProtosGroupContextTypeRequestInfo];
|
||
|
[groupContextBuilder setId:self.groupId];
|
||
|
|
||
|
OWSSignalServiceProtosDataMessageBuilder *builder = [OWSSignalServiceProtosDataMessageBuilder new];
|
||
|
[builder setGroupBuilder:groupContextBuilder];
|
||
|
|
||
|
return builder;
|
||
|
}
|
||
|
|
||
|
@end
|
||
|
|
||
|
NS_ASSUME_NONNULL_END
|