Private
Public Access
1
0

adds some clues about how to implement tapbacks

This commit is contained in:
James Magahern
2024-10-02 17:18:44 -07:00
parent 9007b4503f
commit d0e1f51b6b
2 changed files with 103 additions and 1 deletions

View File

@@ -57,6 +57,26 @@
return result;
}
#if 0
- (NSDictionary *)adjustMessageSummaryInfoForSending:(NSDictionary *)messageSummaryInfo
{
NSMutableDictionary *adjustedInfo = [messageSummaryInfo mutableCopy];
if (!adjustedInfo) {
adjustedInfo = [NSMutableDictionary dictionary];
}
if ([fullText length] > 50) {
summary = [[summary substringToIndex:[summary rangeOfComposedCharacterSequenceAtIndex:kMaxSummaryLength].location] stringByAppendingString:@"…"];
adjustedInfo[IMMessageSummaryInfoSummary] = summary;
}
adjustedInfo[IMMessageSummaryInfoTapbackRepresentationKey] = @"Loved";
return adjustedInfo;
}
#endif
- (void)main
{
NSObject<HTTPResponse> *response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
@@ -75,6 +95,17 @@
return;
}
// tapbacks
#if 0
IMMessage *acknowledgment = [IMMessage instantMessageWithAssociatedMessageContent: /* [NSString stringWithFormat:@"%@ \"%%@\"", tapbackAction] */
flags:0
associatedMessageGUID:guid
associatedMessageType:IMAssociatedMessageTypeAcknowledgmentHeart
associatedMessageRange:[imMessage messagePartRange]
messageSummaryInfo:[self adjustMessageSummaryInfoForSending:message]
threadIdentifier:[imMessage threadIdentifier]];
#endif
NSArray *transferGUIDs = [args objectForKey:@"fileTransferGUIDs"];
if (!transferGUIDs) {
transferGUIDs = @[];