Skip to content

Commit

Permalink
Merge pull request #1420 from nextcloud/markdown-performance
Browse files Browse the repository at this point in the history
Markdown performance
  • Loading branch information
Ivansss committed Nov 17, 2023
2 parents 9079a95 + 2b855d2 commit 8c3f351
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion NextcloudTalk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3197,7 +3197,7 @@
repositoryURL = "https://github.com/nextcloud-deps/CDMarkdownKit.git";
requirement = {
kind = revision;
revision = a46582f9ec7ff58852231555f53cd267313d20cc;
revision = 6c175aade4227d5b04b93356f8df5bfd7b08f8c8;
};
};
1F0ECBFB2A73F21A00921E90 /* XCRemoteSwiftPackageReference "realm-swift" */ = {
Expand Down
8 changes: 7 additions & 1 deletion NextcloudTalk/RoomsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,13 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
// Set last activity
if (room.lastMessage) {
cell.titleOnly = NO;
cell.subtitleLabel.text = room.lastMessageString;

// Only use the first 80 characters of the message, so we don't need to calculate the label size for the whole message
NSString *lastRoomMessage = room.lastMessageString;
NSRange stringRange = {0, MIN([lastRoomMessage length], 80)};

stringRange = [lastRoomMessage rangeOfComposedCharacterSequencesForRange:stringRange];
cell.subtitleLabel.text = [lastRoomMessage substringWithRange:stringRange];
} else {
cell.titleOnly = YES;
}
Expand Down
1 change: 1 addition & 0 deletions NextcloudTalk/SwiftMarkdownObjCBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import UIKit
markdownParser.squashNewlines = false
markdownParser.overwriteExistingStyle = false
markdownParser.trimLeadingWhitespaces = false
markdownParser.automaticLinkDetectionEnabled = false

markdownParser.image.enabled = false

Expand Down

0 comments on commit 8c3f351

Please sign in to comment.