Adds conversation delete option
This commit is contained in:
@@ -81,6 +81,7 @@
|
|||||||
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD602061219B68950024D9C5 /* MBIMSendMessageOperation.m */; };
|
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD602061219B68950024D9C5 /* MBIMSendMessageOperation.m */; };
|
||||||
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E155219BE10A00F4CCEA /* hooking.m */; };
|
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E155219BE10A00F4CCEA /* hooking.m */; };
|
||||||
CD83E166219BE91600F4CCEA /* agentHook.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E165219BE91600F4CCEA /* agentHook.m */; };
|
CD83E166219BE91600F4CCEA /* agentHook.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E165219BE91600F4CCEA /* agentHook.m */; };
|
||||||
|
CDDCF78D283F398C0087ABDF /* MBIMDeleteConversationOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDDCF78C283F398C0087ABDF /* MBIMDeleteConversationOperation.m */; };
|
||||||
CDE4556421A3578A0041F5DD /* IMChat+Encoded.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */; };
|
CDE4556421A3578A0041F5DD /* IMChat+Encoded.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */; };
|
||||||
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */; };
|
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */; };
|
||||||
CDE455A421A5308D0041F5DD /* MBIMFetchAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */; };
|
CDE455A421A5308D0041F5DD /* MBIMFetchAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */; };
|
||||||
@@ -236,6 +237,8 @@
|
|||||||
CD83E161219BE91500F4CCEA /* libagentHook.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libagentHook.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
|
CD83E161219BE91500F4CCEA /* libagentHook.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libagentHook.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
CD83E165219BE91600F4CCEA /* agentHook.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = agentHook.m; sourceTree = "<group>"; };
|
CD83E165219BE91600F4CCEA /* agentHook.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = agentHook.m; sourceTree = "<group>"; };
|
||||||
CD83E1B5219BF78E00F4CCEA /* hookAgent.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = hookAgent.sh; sourceTree = "<group>"; };
|
CD83E1B5219BF78E00F4CCEA /* hookAgent.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = hookAgent.sh; sourceTree = "<group>"; };
|
||||||
|
CDDCF78B283F398C0087ABDF /* MBIMDeleteConversationOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMDeleteConversationOperation.h; sourceTree = "<group>"; };
|
||||||
|
CDDCF78C283F398C0087ABDF /* MBIMDeleteConversationOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMDeleteConversationOperation.m; sourceTree = "<group>"; };
|
||||||
CDE4556221A3578A0041F5DD /* IMChat+Encoded.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IMChat+Encoded.h"; sourceTree = "<group>"; };
|
CDE4556221A3578A0041F5DD /* IMChat+Encoded.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IMChat+Encoded.h"; sourceTree = "<group>"; };
|
||||||
CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "IMChat+Encoded.m"; sourceTree = "<group>"; };
|
CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "IMChat+Encoded.m"; sourceTree = "<group>"; };
|
||||||
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMMarkOperation.h; sourceTree = "<group>"; };
|
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMMarkOperation.h; sourceTree = "<group>"; };
|
||||||
@@ -526,6 +529,8 @@
|
|||||||
CD60205B219B623F0024D9C5 /* MBIMMessagesListOperation.m */,
|
CD60205B219B623F0024D9C5 /* MBIMMessagesListOperation.m */,
|
||||||
CD60205D219B674B0024D9C5 /* MBIMConversationListOperation.h */,
|
CD60205D219B674B0024D9C5 /* MBIMConversationListOperation.h */,
|
||||||
CD60205E219B674B0024D9C5 /* MBIMConversationListOperation.m */,
|
CD60205E219B674B0024D9C5 /* MBIMConversationListOperation.m */,
|
||||||
|
CDDCF78B283F398C0087ABDF /* MBIMDeleteConversationOperation.h */,
|
||||||
|
CDDCF78C283F398C0087ABDF /* MBIMDeleteConversationOperation.m */,
|
||||||
CDE455A221A5308D0041F5DD /* MBIMFetchAttachmentOperation.h */,
|
CDE455A221A5308D0041F5DD /* MBIMFetchAttachmentOperation.h */,
|
||||||
CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */,
|
CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */,
|
||||||
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */,
|
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */,
|
||||||
@@ -836,6 +841,7 @@
|
|||||||
CD2ECEC526953F2A0055E302 /* MBIMAuthToken.m in Sources */,
|
CD2ECEC526953F2A0055E302 /* MBIMAuthToken.m in Sources */,
|
||||||
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */,
|
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */,
|
||||||
1AAB32B121F82EB7004A2A72 /* MBIMLogging.m in Sources */,
|
1AAB32B121F82EB7004A2A72 /* MBIMLogging.m in Sources */,
|
||||||
|
CDDCF78D283F398C0087ABDF /* MBIMDeleteConversationOperation.m in Sources */,
|
||||||
1AD8936E21EFD986009B599A /* MBIMUploadAttachmentOperation.m in Sources */,
|
1AD8936E21EFD986009B599A /* MBIMUploadAttachmentOperation.m in Sources */,
|
||||||
CDF6233A219A8A5600690038 /* MBIMBridge.m in Sources */,
|
CDF6233A219A8A5600690038 /* MBIMBridge.m in Sources */,
|
||||||
CDF62335219A895D00690038 /* main.m in Sources */,
|
CDF62335219A895D00690038 /* main.m in Sources */,
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MBIMDeleteConversationOperation.h
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 5/25/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMBridgeOperation.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMDeleteConversationOperation : MBIMBridgeOperation
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
//
|
||||||
|
// MBIMDeleteConversationOperation.m
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 5/25/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMDeleteConversationOperation.h"
|
||||||
|
#import "IMChat+Encoded.h"
|
||||||
|
|
||||||
|
#import "IMCore_ClassDump.h"
|
||||||
|
|
||||||
|
@implementation MBIMDeleteConversationOperation
|
||||||
|
+ (void)load { [super load]; }
|
||||||
|
|
||||||
|
+ (NSString *)endpointName
|
||||||
|
{
|
||||||
|
return @"delete";
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)main
|
||||||
|
{
|
||||||
|
__block NSObject<HTTPResponse> *response = nil;
|
||||||
|
do {
|
||||||
|
NSString *guid = [self valueForQueryItemWithName:@"guid"];
|
||||||
|
|
||||||
|
if (!guid) {
|
||||||
|
MBIMLogInfo(@"No conversation GUID provided.");
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatch_sync([[self class] sharedIMAccessQueue], ^{
|
||||||
|
IMChat *chat = [[IMChatRegistry sharedInstance] existingChatWithGUID:guid];
|
||||||
|
if (!chat) {
|
||||||
|
MBIMLogInfo(@"Chat with guid: %@ not found", guid);
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
|
} else {
|
||||||
|
[chat remove];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:200];
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
self.serverCompletionBlock(response);
|
||||||
|
}
|
||||||
|
@end
|
||||||
Reference in New Issue
Block a user