mirror of https://github.com/oxen-io/session-ios
Elaborate request factory.
parent
df9cc1d9a6
commit
0ca497846b
@ -1,14 +0,0 @@
|
||||
// Created by Michael Kirk on 12/19/16.
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "TSRequest.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OWSAcknowledgeMessageDeliveryRequest : TSRequest
|
||||
|
||||
- (instancetype)initWithSource:(NSString *)source timestamp:(UInt64)timestamp;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,23 +0,0 @@
|
||||
// Created by Michael Kirk on 12/19/16.
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "OWSAcknowledgeMessageDeliveryRequest.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSAcknowledgeMessageDeliveryRequest
|
||||
|
||||
- (instancetype)initWithSource:(NSString *)source timestamp:(UInt64)timestamp
|
||||
{
|
||||
NSString *path = [NSString stringWithFormat:@"v1/messages/%@/%llu", source, timestamp];
|
||||
NSURL *url = [NSURL URLWithString:path];
|
||||
|
||||
self = [super initWithURL:url];
|
||||
self.HTTPMethod = @"DELETE";
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,17 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TSRequest.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class OWSDevice;
|
||||
|
||||
@interface OWSDeleteDeviceRequest : TSRequest
|
||||
|
||||
- (instancetype)initWithDevice:(OWSDevice *)device;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,27 +0,0 @@
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "OWSDeleteDeviceRequest.h"
|
||||
#import "OWSDevice.h"
|
||||
#import "TSConstants.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSDeleteDeviceRequest
|
||||
|
||||
- (instancetype)initWithDevice:(OWSDevice *)device
|
||||
{
|
||||
NSString *deleteDevicePath = [NSString
|
||||
stringWithFormat:textSecureDevicesAPIFormat, [NSString stringWithFormat:@"%ld", (long)device.deviceId]];
|
||||
self = [super initWithURL:[NSURL URLWithString:deleteDevicePath]];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
[self setHTTPMethod:@"DELETE"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,11 +0,0 @@
|
||||
// Copyright (c) 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "TSRequest.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OWSDeviceProvisioningCodeRequest : TSRequest
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,24 +0,0 @@
|
||||
// Copyright (c) 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "OWSDeviceProvisioningCodeRequest.h"
|
||||
#import "TSConstants.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSDeviceProvisioningCodeRequest
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super initWithURL:[NSURL URLWithString:textSecureDeviceProvisioningCodeAPI]];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
[self setHTTPMethod:@"GET"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,13 +0,0 @@
|
||||
// Copyright (c) 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "TSRequest.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OWSDeviceProvisioningRequest : TSRequest
|
||||
|
||||
- (instancetype)initWithMessageBody:(NSData *)messageBody ephemeralDeviceId:(NSString *)deviceId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,32 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSDeviceProvisioningRequest.h"
|
||||
#import "TSConstants.h"
|
||||
#import <SignalServiceKit/NSData+Base64.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSDeviceProvisioningRequest
|
||||
|
||||
- (instancetype)initWithMessageBody:(NSData *)messageBody ephemeralDeviceId:(NSString *)deviceId
|
||||
{
|
||||
NSString *path = [NSString stringWithFormat:textSecureDeviceProvisioningAPIFormat, deviceId];
|
||||
self = [super initWithURL:[NSURL URLWithString:path]];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
self.HTTPMethod = @"PUT";
|
||||
|
||||
self.parameters = @{
|
||||
@"body" : [messageBody base64EncodedString],
|
||||
};
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
Loading…
Reference in New Issue