Shorten long messages in chat view, so that they stay readable.

This commit is contained in:
Guillaume BIENKOWSKI 2013-10-02 12:06:17 +02:00
parent 3eec08773c
commit b189297839

View file

@ -116,7 +116,12 @@
if([chat isExternalImage] || [chat isInternalImage]) {
[chatContentLabel setText:@""];
} else {
[chatContentLabel setText:[chat message]];
NSString *message = [chat message];
// shorten long messages
if([message length] > 50)
message = [[message substringToIndex:50] stringByAppendingString:@"[...]"];
[chatContentLabel setText:message];
}
int count = [ChatModel unreadMessages:[chat remoteContact]];