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.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import <IMCore/IMCore.h>
|
|
|
|
|
#import <IMFoundation/IMFoundation.h>
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
|
|
|
typedef void (^MBIMUpdateConsumer)(MBIMUpdateItem *item);
|
|
|
|
|
|
|
|
|
|
@interface MBIMUpdateQueue : NSObject
|
|
|
|
|
|
|
|
|
|
+ (instancetype)sharedInstance;
|
|
|
|
|
|
|
|
|
|
- (void)addConsumer:(MBIMUpdateConsumer)consumer;
|
2018-11-20 19:57:35 -07:00
|
|
|
- (void)removeConsumer:(MBIMUpdateConsumer)consumer;
|
|
|
|
|
|
2018-11-17 01:07:55 -08:00
|
|
|
- (void)enqueueUpdateItem:(MBIMUpdateItem *)item;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|