summaryrefslogtreecommitdiff
path: root/Juick/Model/Chat.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-12-02 23:23:31 +0300
committerGravatar Vitaly Takmazov2018-12-02 23:23:31 +0300
commita293a8e049fea49b8c2b8262fb92a29f73d66989 (patch)
tree2201a139fc19fcac59714e915f08b0aa7e816517 /Juick/Model/Chat.m
parent3bc3a38be7ccaf9622bdc86ffac37827af36f0f1 (diff)
Drop YYModel
Diffstat (limited to 'Juick/Model/Chat.m')
-rw-r--r--Juick/Model/Chat.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/Juick/Model/Chat.m b/Juick/Model/Chat.m
index ff5fb83..66ed394 100644
--- a/Juick/Model/Chat.m
+++ b/Juick/Model/Chat.m
@@ -10,4 +10,15 @@
@implementation Chat
++(Chat *) fromJSON:(NSDictionary *)jsonData {
+ Chat *user = [Chat new];
+ user.uid = jsonData[@"uid"];
+ user.uname = jsonData[@"uname"];
+ user.avatar = jsonData[@"avatar"];
+ user.unreadCount = jsonData[@"unreadCount"];
+ user.lastMessageTimestamp = jsonData[@"lastMessageTimestamp"];
+ user.lastMessageText = jsonData[@"lastMessageText"];
+ return user;
+}
+
@end