diff --git a/Makefile b/Makefile index 4f811a4..e3b73f4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ INSTALL_PATH := /usr/share/kordophone +.PHONY: build/Release/kordophoned build/Release/kordophoned: xcodebuild diff --git a/kordophone/Bridge/Operations/Utilities/MBIMJSONDataResponse.m b/kordophone/Bridge/Operations/Utilities/MBIMJSONDataResponse.m index 41bd25a..d404a3e 100644 --- a/kordophone/Bridge/Operations/Utilities/MBIMJSONDataResponse.m +++ b/kordophone/Bridge/Operations/Utilities/MBIMJSONDataResponse.m @@ -12,8 +12,10 @@ + (instancetype)responseWithJSONObject:(id)object { - NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:NULL]; + NSError *error = nil; + NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:&error]; if (data == nil) { + NSLog(@"JSON encoding error: %@", error); return nil; } diff --git a/kordophone/Categories/IMChat+Encoded.m b/kordophone/Categories/IMChat+Encoded.m index d74d966..7cdad49 100644 --- a/kordophone/Categories/IMChat+Encoded.m +++ b/kordophone/Categories/IMChat+Encoded.m @@ -22,7 +22,8 @@ IMMessage *lastMessage = [self lastMessage]; if (lastMessage) { - chatDict[@"lastMessagePreview"] = [lastMessage descriptionForPurpose:IMMessageDescriptionConversationList]; + NSString *lastMessagePreview = [lastMessage descriptionForPurpose:IMMessageDescriptionConversationList]; + chatDict[@"lastMessagePreview"] = [lastMessagePreview substringToIndex:MIN(128, [lastMessagePreview length])]; chatDict[@"lastMessage"] = [lastMessage mbim_dictionaryRepresentation]; }