2018-11-17 01:07:55 -08:00
|
|
|
//
|
|
|
|
|
// MBIMUpdateQueue.h
|
|
|
|
|
// kordophoned
|
|
|
|
|
//
|
|
|
|
|
// Created by James Magahern on 11/16/18.
|
|
|
|
|
// Copyright © 2018 James Magahern. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
2019-12-16 17:29:53 -08:00
|
|
|
#import "IMCore_ClassDump.h"
|
|
|
|
|
#import "IMFoundation_ClassDump.h"
|
2018-11-17 01:07:55 -08:00
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
2023-01-17 16:16:23 -08:00
|
|
|
@class GCDAsyncSocket;
|
|
|
|
|
@class HTTPMessage;
|
|
|
|
|
@class WebSocket;
|
2018-11-17 01:07:55 -08:00
|
|
|
|
|
|
|
|
@interface MBIMUpdateItem : NSObject
|
|
|
|
|
@property (nonatomic, strong) IMChat *changedChat;
|
2018-11-20 19:57:35 -07:00
|
|
|
@property (nonatomic, strong) IMMessage *addedMessage;
|
|
|
|
|
|
|
|
|
|
- (NSDictionary *)dictionaryRepresentation;
|
2018-11-17 01:07:55 -08:00
|
|
|
@end
|
|
|
|
|
|
2018-11-21 15:51:51 -07:00
|
|
|
typedef void (^MBIMUpdateConsumer)(NSArray<MBIMUpdateItem *> *items);
|
2018-11-17 01:07:55 -08:00
|
|
|
|
|
|
|
|
@interface MBIMUpdateQueue : NSObject
|
|
|
|
|
|
|
|
|
|
+ (instancetype)sharedInstance;
|
|
|
|
|
|
2023-01-17 16:16:23 -08:00
|
|
|
- (void)addPollingConsumer:(MBIMUpdateConsumer)consumer withLastSyncedMessageSeq:(NSInteger)messageSeq;
|
|
|
|
|
- (void)removePollingConsumer:(MBIMUpdateConsumer)consumer;
|
2018-11-20 19:57:35 -07:00
|
|
|
|
2018-11-17 01:07:55 -08:00
|
|
|
- (void)enqueueUpdateItem:(MBIMUpdateItem *)item;
|
|
|
|
|
|
2023-01-17 16:16:23 -08:00
|
|
|
- (WebSocket *)vendUpdateWebSocketConsumerForRequest:(HTTPMessage *)request socket:(GCDAsyncSocket *)socket;
|
|
|
|
|
|
2018-11-17 01:07:55 -08:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|