Supports polling for updates
This commit is contained in:
24
kordophone/Categories/IMMessageItem+Encoded.h
Normal file
24
kordophone/Categories/IMMessageItem+Encoded.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// IMMessageItem+Encoded.h
|
||||
// kordophoned
|
||||
//
|
||||
// Created by James Magahern on 11/16/18.
|
||||
// Copyright © 2018 James Magahern. All rights reserved.
|
||||
//
|
||||
|
||||
#import <IMCore/IMCore.h>
|
||||
#import <IMSharedUtilities/IMSharedUtilities.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface IMMessage (Encoded)
|
||||
- (NSDictionary *)mbim_dictionaryRepresentation;
|
||||
|
||||
@end
|
||||
|
||||
@interface IMMessageItem (Encoded)
|
||||
- (NSDictionary *)mbim_dictionaryRepresentation;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
38
kordophone/Categories/IMMessageItem+Encoded.m
Normal file
38
kordophone/Categories/IMMessageItem+Encoded.m
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// IMMessageItem+Encoded.m
|
||||
// kordophoned
|
||||
//
|
||||
// Created by James Magahern on 11/16/18.
|
||||
// Copyright © 2018 James Magahern. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IMMessageItem+Encoded.h"
|
||||
#import "MBIMHTTPUtilities.h"
|
||||
|
||||
@implementation IMMessage (Encoded)
|
||||
|
||||
- (NSDictionary *)mbim_dictionaryRepresentation
|
||||
{
|
||||
NSMutableDictionary *messageDict = [NSMutableDictionary dictionary];
|
||||
messageDict[@"text"] = [[self text] string];
|
||||
messageDict[@"date"] = MBIMWebServerFormatRFC822([self time]);
|
||||
messageDict[@"sender"] = [[self sender] displayID];
|
||||
|
||||
return messageDict;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation IMMessageItem (Encoded)
|
||||
|
||||
- (NSDictionary *)mbim_dictionaryRepresentation
|
||||
{
|
||||
NSMutableDictionary *messageDict = [NSMutableDictionary dictionary];
|
||||
messageDict[@"text"] = [[self body] string];
|
||||
messageDict[@"date"] = MBIMWebServerFormatRFC822([self time]);
|
||||
messageDict[@"sender"] = [self sender];
|
||||
|
||||
return messageDict;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user