From 130384470a997fa6b5b21c2eccbbfca17c3128e8 Mon Sep 17 00:00:00 2001 From: Toru the Red Fox Date: Thu, 8 Aug 2024 17:53:56 +0000 Subject: [PATCH] The absolute stupidest attempt at a fix, hope it works --- Discord Classic/DCChannel.m | 14 +++++++------- Discord Classic/DCMessage.m | 2 +- Discord Classic/DCTools.m | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Discord Classic/DCChannel.m b/Discord Classic/DCChannel.m index b45710f..65cf1aa 100755 --- a/Discord Classic/DCChannel.m +++ b/Discord Classic/DCChannel.m @@ -53,7 +53,7 @@ -(void)checkIfRead{ - (void)sendMessage:(NSString*)message { dispatch_async([self get_channel_send_queue], ^{ - NSURL* channelURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discord.com/api/v9/channels/%@/messages", self.snowflake]]; + NSURL* channelURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discordapp.com/api/v9/channels/%@/messages", self.snowflake]]; NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:channelURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:10]; [urlRequest setValue:@"no-store" forHTTPHeaderField:@"Cache-Control"]; @@ -92,7 +92,7 @@ - (void)sendImage:(UIImage*)image mimeType:(NSString*)type { dispatch_async(dispatch_get_main_queue(), ^{ [UIApplication sharedApplication].networkActivityIndicatorVisible++; }); - NSURL* channelURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discord.com/api/v9/channels/%@/messages", self.snowflake]]; + NSURL* channelURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discordapp.com/api/v9/channels/%@/messages", self.snowflake]]; NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:channelURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:30]; [urlRequest setValue:@"no-store" forHTTPHeaderField:@"Cache-Control"]; @@ -141,7 +141,7 @@ - (void)sendData:(NSData*)data mimeType:(NSString*)type { dispatch_async(dispatch_get_main_queue(), ^{ [UIApplication sharedApplication].networkActivityIndicatorVisible++; }); - NSURL* channelURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discord.com/api/v9/channels/%@/messages", self.snowflake]]; + NSURL* channelURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discordapp.com/api/v9/channels/%@/messages", self.snowflake]]; NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:channelURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:30]; [urlRequest setValue:@"no-store" forHTTPHeaderField:@"Cache-Control"]; @@ -187,7 +187,7 @@ - (void)sendVideo:(NSURL*)videoURL mimeType:(NSString*)type { dispatch_async(dispatch_get_main_queue(), ^{ [UIApplication sharedApplication].networkActivityIndicatorVisible++; }); - NSURL* channelURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discord.com/api/v9/channels/%@/messages", self.snowflake]]; + NSURL* channelURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discordapp.com/api/v9/channels/%@/messages", self.snowflake]]; NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:channelURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:30]; @@ -239,7 +239,7 @@ - (void)sendVideo:(NSURL*)videoURL mimeType:(NSString*)type { - (void)sendTypingIndicator{ dispatch_async([self get_channel_event_queue], ^{ - NSURL* channelURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://discord.com/api/v9/channels/%@/typing", self.snowflake]]; + NSURL* channelURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://discordapp.com/api/v9/channels/%@/typing", self.snowflake]]; NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:channelURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:5]; // low timeout to avoid API spam [urlRequest setValue:@"no-store" forHTTPHeaderField:@"Cache-Control"]; @@ -264,7 +264,7 @@ - (void)sendTypingIndicator{ - (void)ackMessage:(NSString*)messageId{ self.lastReadMessageId = messageId; dispatch_async([self get_channel_event_queue], ^{ - NSURL* channelURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://discord.com/api/v9/channels/%@/messages/%@/ack", self.snowflake, messageId]]; + NSURL* channelURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://discordapp.com/api/v9/channels/%@/messages/%@/ack", self.snowflake, messageId]]; NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:channelURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:10]; [urlRequest setValue:@"no-store" forHTTPHeaderField:@"Cache-Control"]; @@ -298,7 +298,7 @@ - (NSArray*)getMessages:(int)numberOfMessages beforeMessage:(DCMessage*)message{ NSMutableArray* messages = NSMutableArray.new; //Generate URL from args - NSMutableString* getChannelAddress = [[NSString stringWithFormat: @"https://discord.com/api/v9/channels/%@/messages?", self.snowflake] mutableCopy]; + NSMutableString* getChannelAddress = [[NSString stringWithFormat: @"https://discordapp.com/api/v9/channels/%@/messages?", self.snowflake] mutableCopy]; if(numberOfMessages) [getChannelAddress appendString:[NSString stringWithFormat:@"limit=%i", numberOfMessages]]; diff --git a/Discord Classic/DCMessage.m b/Discord Classic/DCMessage.m index dddc153..2a382ea 100755 --- a/Discord Classic/DCMessage.m +++ b/Discord Classic/DCMessage.m @@ -22,7 +22,7 @@ - (dispatch_queue_t)get_messages_delete_queue { - (void)deleteMessage{ dispatch_async([self get_messages_delete_queue], ^{ - NSURL* messageURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discord.com/api/v9/channels/%@/messages/%@", DCServerCommunicator.sharedInstance.selectedChannel.snowflake, self.snowflake]]; + NSURL* messageURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discordapp.com/api/v9/channels/%@/messages/%@", DCServerCommunicator.sharedInstance.selectedChannel.snowflake, self.snowflake]]; NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:messageURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:10]; [urlRequest setValue:@"no-store" forHTTPHeaderField:@"Cache-Control"]; diff --git a/Discord Classic/DCTools.m b/Discord Classic/DCTools.m index 52b0790..0eed9cc 100755 --- a/Discord Classic/DCTools.m +++ b/Discord Classic/DCTools.m @@ -735,7 +735,7 @@ +(DCGuild *)convertJsonGuild:(NSDictionary*)jsonGuild{ + (void)joinGuild:(NSString*)inviteCode { //dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ - NSURL* guildURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discord.com/api/v9/invite/%@", inviteCode]]; + NSURL* guildURL = [NSURL URLWithString: [NSString stringWithFormat:@"https://discordapp.com/api/v9/invite/%@", inviteCode]]; NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:guildURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:15]; [urlRequest setValue:@"no-store" forHTTPHeaderField:@"Cache-Control"];