mirror of https://github.com/oxen-io/session-ios
Elaborate request factory.
parent
0ca497846b
commit
c17a819366
@ -1,11 +0,0 @@
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "TSRequest.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OWSGetDevicesRequest : TSRequest
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,25 +0,0 @@
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "OWSGetDevicesRequest.h"
|
||||
#import "TSConstants.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSGetDevicesRequest
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
NSString *getDevicesPath = [NSString stringWithFormat:textSecureDevicesAPIFormat, @""];
|
||||
self = [super initWithURL:[NSURL URLWithString:getDevicesPath]];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
[self setHTTPMethod:@"GET"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,12 +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 OWSGetMessagesRequest : TSRequest
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,18 +0,0 @@
|
||||
// Created by Michael Kirk on 12/19/16.
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "OWSGetMessagesRequest.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSGetMessagesRequest
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
NSURL *url = [NSURL URLWithString:@"v1/messages"];
|
||||
return [super initWithURL:url];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,15 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TSRequest.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OWSGetProfileRequest : TSRequest
|
||||
|
||||
- (instancetype)initWithRecipientId:(NSString *)recipientId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,30 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "OWSGetProfileRequest.h"
|
||||
#import "TSConstants.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation OWSGetProfileRequest
|
||||
|
||||
- (instancetype)initWithRecipientId:(NSString *)recipientId
|
||||
{
|
||||
OWSAssert(recipientId.length > 0);
|
||||
|
||||
NSString *path = [NSString stringWithFormat:textSecureProfileAPIFormat, recipientId];
|
||||
self = [super initWithURL:[NSURL URLWithString:path]];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
self.HTTPMethod = @"GET";
|
||||
self.parameters = nil;
|
||||
|
||||
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
|
||||
|
||||
/**
|
||||
* Fetch a list of viable ICE candidates (including TURN and STUN) used for the WebRTC call signaling process.
|
||||
*/
|
||||
NS_SWIFT_NAME(TurnServerInfoRequest)
|
||||
@interface OWSTurnServerInfoRequest : TSRequest
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,26 +0,0 @@
|
||||
// Created by Michael Kirk on 11/12/16.
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "OWSTurnServerInfoRequest.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
NSString *const OWSTurnServerInfoRequestPath = @"v1/accounts/turn";
|
||||
|
||||
@implementation OWSTurnServerInfoRequest
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super initWithURL:[NSURL URLWithString:OWSTurnServerInfoRequestPath]];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
[self setHTTPMethod:@"GET"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -1,13 +0,0 @@
|
||||
//
|
||||
// TSAllocAttachmentRequest.h
|
||||
// Signal
|
||||
//
|
||||
// Created by Frederic Jacobs on 21/12/14.
|
||||
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TSRequest.h"
|
||||
|
||||
@interface TSAllocAttachmentRequest : TSRequest
|
||||
|
||||
@end
|
@ -1,26 +0,0 @@
|
||||
//
|
||||
// TSAllocAttachmentRequest.m
|
||||
// Signal
|
||||
//
|
||||
// Created by Frederic Jacobs on 21/12/14.
|
||||
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TSAllocAttachmentRequest.h"
|
||||
#import "TSConstants.h"
|
||||
|
||||
@implementation TSAllocAttachmentRequest
|
||||
|
||||
- (instancetype)init {
|
||||
NSString *path = [NSString stringWithFormat:@"%@", textSecureAttachmentsAPI];
|
||||
|
||||
self = [super initWithURL:[NSURL URLWithString:path]];
|
||||
|
||||
if (self) {
|
||||
[self setHTTPMethod:@"GET"];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
@ -1,15 +0,0 @@
|
||||
//
|
||||
// TSRequestAttachment.h
|
||||
// TextSecureiOS
|
||||
//
|
||||
// Created by Christine Corbett Moran on 12/1/13.
|
||||
// Copyright (c) 2013 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TSRequest.h"
|
||||
|
||||
@interface TSAttachmentRequest : TSRequest
|
||||
|
||||
- (TSRequest *)initWithId:(UInt64)attachmentId relay:(NSString *)relay;
|
||||
|
||||
@end
|
@ -1,28 +0,0 @@
|
||||
//
|
||||
// TSRequestAttachment.m
|
||||
// TextSecureiOS
|
||||
//
|
||||
// Created by Christine Corbett Moran on 12/1/13.
|
||||
// Copyright (c) 2013 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TSAttachmentRequest.h"
|
||||
#import "TSConstants.h"
|
||||
|
||||
@implementation TSAttachmentRequest
|
||||
|
||||
- (TSRequest *)initWithId:(UInt64)attachmentId relay:(NSString *)relay
|
||||
{
|
||||
NSString *path = [NSString stringWithFormat:@"%@/%llu", textSecureAttachmentsAPI, attachmentId];
|
||||
|
||||
if (relay && ![relay isEqualToString:@""]) {
|
||||
path = [path stringByAppendingFormat:@"?relay=%@", relay];
|
||||
}
|
||||
|
||||
self = [super initWithURL:[NSURL URLWithString:path]];
|
||||
|
||||
self.HTTPMethod = @"GET";
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in New Issue