summaryrefslogtreecommitdiff
path: root/Juick/Model
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-10-31 16:16:48 +0300
committerGravatar Vitaly Takmazov2020-05-12 16:38:25 +0300
commit9d78e7d654c51c22ce4be87efef5bc1f8d5a2d08 (patch)
treedfb028dfca07fdb7bbacc00771f9e865f28fd6d4 /Juick/Model
parent742e1a0e615a7e07a9f4b4c249227cd63839325f (diff)
Fix authentication
Diffstat (limited to 'Juick/Model')
-rw-r--r--Juick/Model/Message.m1
-rw-r--r--Juick/Model/User.h1
-rw-r--r--Juick/Model/User.m2
3 files changed, 2 insertions, 2 deletions
diff --git a/Juick/Model/Message.m b/Juick/Model/Message.m
index f5c2640..d39be54 100644
--- a/Juick/Model/Message.m
+++ b/Juick/Model/Message.m
@@ -7,7 +7,6 @@
//
#import "Message.h"
-#import "AppDelegate.h"
@implementation Message
diff --git a/Juick/Model/User.h b/Juick/Model/User.h
index cbf4e46..344626e 100644
--- a/Juick/Model/User.h
+++ b/Juick/Model/User.h
@@ -12,6 +12,7 @@
@property (nonatomic, strong) NSString *uname;
@property (nonatomic, strong) NSString *uid;
@property (nonatomic, strong) NSString *avatar;
+@property (nonatomic, strong) NSString *token;
@property (nonatomic) NSInteger unreadCount;
+ (User *) fromJSON:(NSDictionary *)jsonData;
diff --git a/Juick/Model/User.m b/Juick/Model/User.m
index 94b77c4..a0c34f9 100644
--- a/Juick/Model/User.m
+++ b/Juick/Model/User.m
@@ -7,7 +7,6 @@
//
#import "User.h"
-#import "APIClient.h"
@implementation User
@@ -16,6 +15,7 @@
user.uid = jsonData[@"uid"];
user.uname = jsonData[@"uname"];
user.avatar = jsonData[@"avatar"];
+ user.token = jsonData[@"hash"];
user.unreadCount = [jsonData[@"messagesCount"] integerValue];
return user;
}