2016-08-29 16:28:40 +02:00
|
|
|
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
|
|
|
|
|
|
|
#import "OWSDeviceTableViewCell.h"
|
|
|
|
#import "DateUtil.h"
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
@implementation OWSDeviceTableViewCell
|
|
|
|
|
|
|
|
- (void)configureWithDevice:(OWSDevice *)device
|
|
|
|
{
|
2016-09-02 21:50:36 +02:00
|
|
|
self.nameLabel.text = device.displayName;
|
2016-08-29 16:28:40 +02:00
|
|
|
|
2016-09-09 17:55:07 +02:00
|
|
|
NSString *linkedFormatString
|
|
|
|
= NSLocalizedString(@"DEVICE_LINKED_AT_LABEL", @"{{Short Date}} when device was linked.");
|
2016-08-29 16:28:40 +02:00
|
|
|
self.linkedLabel.text =
|
|
|
|
[NSString stringWithFormat:linkedFormatString, [DateUtil.dateFormatter stringFromDate:device.createdAt]];
|
|
|
|
|
2016-09-09 17:55:07 +02:00
|
|
|
NSString *lastSeenFormatString = NSLocalizedString(
|
|
|
|
@"DEVICE_LAST_ACTIVE_AT_LABEL", @"{{Short Date}} when device last communicated with Signal Server.");
|
2016-08-29 16:28:40 +02:00
|
|
|
self.lastSeenLabel.text =
|
|
|
|
[NSString stringWithFormat:lastSeenFormatString, [DateUtil.dateFormatter stringFromDate:device.createdAt]];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|