Compare commits
2 Commits
Kordophone
...
Kordophone
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37ff0b375f | ||
|
|
d071e68a56 |
@@ -13,6 +13,7 @@
|
|||||||
#import "MBIMBridgeOperation.h"
|
#import "MBIMBridgeOperation.h"
|
||||||
#import "MBIMAuthToken.h"
|
#import "MBIMAuthToken.h"
|
||||||
#import "MBIMUpdateQueue.h"
|
#import "MBIMUpdateQueue.h"
|
||||||
|
#import "MBIMURLUtilities.h"
|
||||||
|
|
||||||
#import <Security/Security.h>
|
#import <Security/Security.h>
|
||||||
#import <CocoaHTTPServer/HTTPMessage.h>
|
#import <CocoaHTTPServer/HTTPMessage.h>
|
||||||
@@ -130,7 +131,14 @@
|
|||||||
{
|
{
|
||||||
NSURL *url = [NSURL URLWithString:path];
|
NSURL *url = [NSURL URLWithString:path];
|
||||||
NSString *endpointName = [url lastPathComponent];
|
NSString *endpointName = [url lastPathComponent];
|
||||||
|
NSString *authTokenString = [url valueForQueryItemWithName:@"token"];
|
||||||
|
MBIMAuthToken *authToken = [[MBIMAuthToken alloc] initWithTokenString:authTokenString];
|
||||||
|
|
||||||
if ([endpointName isEqualToString:@"updates"]) {
|
if ([endpointName isEqualToString:@"updates"]) {
|
||||||
|
if (![authToken isValid]) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
return [[MBIMUpdateQueue sharedInstance] vendUpdateWebSocketConsumerForRequest:request socket:asyncSocket];
|
return [[MBIMUpdateQueue sharedInstance] vendUpdateWebSocketConsumerForRequest:request socket:asyncSocket];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,9 @@
|
|||||||
MBIMLogInfo(@"Chat does not exist: %@", chatGUID);
|
MBIMLogInfo(@"Chat does not exist: %@", chatGUID);
|
||||||
result = NO;
|
result = NO;
|
||||||
} else {
|
} else {
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[chat sendMessage:reply];
|
[chat sendMessage:reply];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user