summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-04-26 18:53:09 +0300
committerGravatar Vitaly Takmazov2023-04-26 18:53:09 +0300
commit9ca85a0132ed9d33dac586e05a048ffcff9b7843 (patch)
tree1a8dab48559fb05c35628247af40d9779beb2715 /Juick
parent0ceb9ab7775d259eacad4be86db160740577c850 (diff)
Display user premium status
Diffstat (limited to 'Juick')
-rw-r--r--Juick/Model/User.h1
-rw-r--r--Juick/Model/User.m1
-rw-r--r--Juick/Views/MessageCell.m6
3 files changed, 7 insertions, 1 deletions
diff --git a/Juick/Model/User.h b/Juick/Model/User.h
index 5393c3d..deea41a 100644
--- a/Juick/Model/User.h
+++ b/Juick/Model/User.h
@@ -15,6 +15,7 @@
@property (nonatomic, strong) NSString *token;
@property (nonatomic, strong) NSString *uri;
@property (nonatomic) NSInteger unreadCount;
+@property (nonatomic, assign) bool premium;
+ (User *) fromJSON:(NSDictionary *)jsonData;
diff --git a/Juick/Model/User.m b/Juick/Model/User.m
index 2401c7e..65f7fe3 100644
--- a/Juick/Model/User.m
+++ b/Juick/Model/User.m
@@ -18,6 +18,7 @@
user.token = jsonData[@"hash"];
user.uri = jsonData[@"uri"];
user.unreadCount = [jsonData[@"messagesCount"] integerValue];
+ user.premium = jsonData[@"premium"];
return user;
}
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m
index ec2c07b..ceb2ac5 100644
--- a/Juick/Views/MessageCell.m
+++ b/Juick/Views/MessageCell.m
@@ -92,7 +92,11 @@ const NSString *unreadMarker = @"●";
self.attachmentHeight.constant = 0;
self.attach.image = nil;
}
- self.title.text = msg.user.uname;
+ if (msg.user.premium) {
+ self.title.text = [NSString stringWithFormat:@"%@ ☆", msg.user.uname];
+ } else {
+ self.title.text = msg.user.uname;
+ }
self.timestamp.text = [[[AppDelegate shared].sharedDateFormatter dateFromString:msg.timestamp] timeAgo];
NSUInteger count = [msg.repliesCount unsignedIntegerValue];