Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Show thumbnails for all image links instead of only the first one

  • Loading branch information...
commit 87ba13bffcb03bc1e464ea9d33d3ecca0ad8370a 1 parent 67ef578
@Kovensky Kovensky authored psychs committed
Showing with 6 additions and 13 deletions.
  1. +6 −13 Classes/Views/Log/LogController.m
View
19 Classes/Views/Log/LogController.m
@@ -438,32 +438,25 @@ - (BOOL)print:(LogLine*)line
BOOL isText = type == LINE_TYPE_PRIVMSG || type == LINE_TYPE_NOTICE || type == LINE_TYPE_ACTION;
BOOL showInlineImage = NO;
+ [s appendFormat:@"<span class=\"message\" type=\"%@\">%@", lineTypeString, body];
if (isText && !console && urlRanges.count && [Preferences showInlineImages]) {
//
// expand image URLs
//
- NSString* imagePageUrl = nil;
NSString* imageUrl = nil;
for (NSValue* rangeValue in urlRanges) {
NSString* url = [line.body substringWithRange:[rangeValue rangeValue]];
imageUrl = [ImageURLParser imageURLForURL:url];
if (imageUrl) {
- imagePageUrl = url;
- break;
+ if(!showInlineImage)
+ [s appendString:@"<br/>"];
+ showInlineImage = YES;
+ [s appendFormat:@"<a href=\"%@\"><img src=\"%@\" class=\"inlineimage\"/></a>", url, imageUrl];
}
}
-
- if (imageUrl) {
- showInlineImage = YES;
- [s appendFormat:@"<span class=\"message\" type=\"%@\">%@<br/>", lineTypeString, body];
- [s appendFormat:@"<a href=\"%@\"><img src=\"%@\" class=\"inlineimage\"/></a></span>", imagePageUrl, imageUrl];
- }
- }
-
- if (!showInlineImage) {
- [s appendFormat:@"<span class=\"message\" type=\"%@\">%@</span>", lineTypeString, body];
}
+ [s appendString:@"</span>"];
NSString* klass = isText ? @"line text" : @"line event";
Please sign in to comment.
Something went wrong with that request. Please try again.