summaryrefslogtreecommitdiff
path: root/Juick/MessageCell.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/MessageCell.m')
-rw-r--r--Juick/MessageCell.m23
1 files changed, 9 insertions, 14 deletions
diff --git a/Juick/MessageCell.m b/Juick/MessageCell.m
index d2b2983..d47c3d2 100644
--- a/Juick/MessageCell.m
+++ b/Juick/MessageCell.m
@@ -57,7 +57,7 @@
[self.summaryLabel setTextAlignment:NSTextAlignmentLeft];
[self.summaryLabel setTextColor:[UIColor grayColor]];
[self.summaryLabel setBackgroundColor:[UIColor clearColor]];
- self.attach = [[UIImageView alloc]initWithImage:[UIImage imageWithImage:[UIImage imageNamed:@"AttachPlaceholder.png"] convertToWidth:300.0f]];
+ self.attach = [[UIImageView alloc] initWithFrame:CGRectZero];
[self.attach setBackgroundColor:[UIColor clearColor]];
self.attach.contentMode = UIViewContentModeTopLeft;
@@ -152,7 +152,6 @@
- (void) setMessage:(Message *)msg {
_message = msg;
[self.avatar setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://i.juick.com/as/%d.png", [msg.userID intValue]]] placeholderImage:[UIImage imageNamed:@"0.png"] options:SDWebImageContinueInBackground];
- __weak MessageCell *weakSelf = self;
self.titleLabel.text = msg.user;
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
@@ -173,21 +172,17 @@
self.bodyLabel.text = [[NSString alloc] initWithFormat:@"%@\n%@", [msg.tags componentsJoinedByString:@", "],
[msg.text stringByDecodingHTMLEntities]];
}
- if ([msg.attach length] > 0) {
- SDWebImageManager * manager = [SDWebImageManager sharedManager];
- [manager downloadWithURL:[NSURL URLWithString:msg.attach] options:SDWebImageContinueInBackground progress:^(NSUInteger receivedSize, long long expectedSize) {
- // <#code#>
- } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) {
- self.attach.image = [UIImage imageWithImage:image convertToWidth:300.0f];
- [self setNeedsLayout];
- [self layoutIfNeeded];
- }];
- } else {
- self.attach.image = nil;
- }
[self setNeedsLayout];
}
+- (UITableView *) getTable {
+ id view = [self superview];
+ while ([view isKindOfClass:[UITableView class]] == NO) {
+ view = [view superview];
+ }
+ return (UITableView *)view;
+}
+
- (void) attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url {
[[UIApplication sharedApplication] openURL:url];
}