Private
Public Access
1
0

Supports polling for updates

This commit is contained in:
James Magahern
2018-11-17 01:07:55 -08:00
parent 464e9fe22c
commit ddec4be8d6
12 changed files with 316 additions and 11 deletions

View 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

View 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