12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- /************************************************************
- * * EaseMob CONFIDENTIAL
- * __________________
- * Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved.
- *
- * NOTICE: All information contained herein is, and remains
- * the property of EaseMob Technologies.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * from EaseMob Technologies.
- */
- #import "MessageModel.h"
- @implementation MessageModel
- - (instancetype)init
- {
- self = [super init];
-
- if (self)
- {
- //code
- }
-
- return self;
- }
- - (void)dealloc{
-
- }
- - (BOOL)isSummaryMessage {
- if (self.message.ext) {
- NSString *type = self.message.ext[EXT_MSG_MESSAGE_TYPE];
- if (type && type.intValue == 1) {
- return YES;
- } else {
- NSDictionary *dict = self.message.ext[EXT_MSG_TYPE_V2];
- if ([dict isKindOfClass:[NSDictionary class]]) {
- NSString *trackType = dict[EXT_MSG_TYPE_TRACK_V2];
- NSString *orderType = dict[EXT_MSG_TYPE_ORDER_V2];
-
- if (trackType || orderType) {
- return YES;
- }
- }
- }
- }
- return NO;
- }
- - (BOOL)isEnquiryMessage {
- NSString *ctrlType = self.message.ext[@"weichat"][@"ctrlType"];
- if ([ctrlType isKindOfClass:[NSString class]] && [ctrlType isEqualToString:@"inviteEnquiry"]) {
- return YES;
- }
- return NO;
- }
- - (BOOL)isAssistantMessage {
- if (self.message.ext) {
- NSString *type = self.message.ext[EXT_MSG_MESSAGE_TYPE];
- if (type.intValue >= 3 && type.intValue <= 5) {
- return YES;
- }
- }
- return NO;
- }
- - (AssistantMessageType)getAssistantMessageType {
- if (self.message.ext) {
- NSString *type = self.message.ext[EXT_MSG_MESSAGE_TYPE];
- if (type) { return (AssistantMessageType)type.intValue; }
- }
- return AssistantMessageTypeDefault;
- }
- - (EMMessageStatus)status
- {
- return _message.status;
- }
- @end
|