2015-10-01 18:19:52 +02:00
|
|
|
#import "TGMessageViewFooterController.h"
|
|
|
|
|
|
|
|
#import "TGDateUtils.h"
|
|
|
|
|
|
|
|
#import "TGBridgeMessage.h"
|
|
|
|
|
|
|
|
NSString *const TGMessageViewFooterIdentifier = @"TGMessageViewFooter";
|
|
|
|
|
|
|
|
@implementation TGMessageViewFooterController
|
|
|
|
|
|
|
|
- (void)updateWithMessage:(TGBridgeMessage *)message channel:(bool)channel
|
|
|
|
{
|
|
|
|
self.dateLabel.text = [TGDateUtils stringForFullDate:message.date];
|
|
|
|
self.timeLabel.text = [TGDateUtils stringForShortTime:message.date];
|
|
|
|
|
2016-02-25 01:03:51 +01:00
|
|
|
self.forwardLabel.text = TGLocalized(@"Watch.MessageView.Forward");
|
|
|
|
self.replyLabel.text = TGLocalized(@"Watch.MessageView.Reply");
|
|
|
|
self.viewLabel.text = TGLocalized(@"Watch.MessageView.ViewOnPhone");
|
2015-10-01 18:19:52 +02:00
|
|
|
|
|
|
|
if (channel)
|
|
|
|
{
|
|
|
|
self.forwardButton.hidden = true;
|
|
|
|
self.replyButton.hidden = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)forwardButtonPressedAction
|
|
|
|
{
|
|
|
|
if (self.forwardPressed != nil)
|
|
|
|
self.forwardPressed();
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)replyButtonPressedAction
|
|
|
|
{
|
|
|
|
if (self.replyPressed != nil)
|
|
|
|
self.replyPressed();
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)viewButtonPressedAction
|
|
|
|
{
|
|
|
|
if (self.viewPressed != nil)
|
|
|
|
self.viewPressed();
|
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSString *)identifier
|
|
|
|
{
|
|
|
|
return TGMessageViewFooterIdentifier;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|