Skip to content

Commit

Permalink
Enable file attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsandriesse committed Oct 23, 2019
1 parent ec5ce16 commit 984f732
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -3513,7 +3513,6 @@ - (void)attachmentButtonPressed
[gifAction setValue:gifImage forKey:@"image"];
[actionSheet addAction:gifAction];

/*
UIAlertAction *chooseDocumentAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"MEDIA_FROM_DOCUMENT_PICKER_BUTTON",
@"action sheet button title when choosing attachment type")
Expand All @@ -3527,6 +3526,7 @@ - (void)attachmentButtonPressed
[chooseDocumentAction setValue:chooseDocumentImage forKey:@"image"];
[actionSheet addAction:chooseDocumentAction];

/*
if (kIsSendingContactSharesEnabled) {
UIAlertAction *chooseContactAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"ATTACHMENT_MENU_CONTACT_BUTTON",
Expand Down
4 changes: 3 additions & 1 deletion SignalServiceKit/src/Messages/OWSMessageSender.m
Expand Up @@ -1221,7 +1221,9 @@ - (void)sendMessage:(OWSMessageSend *)messageSend
for (NSString *attachmentID in message.attachmentIds) {
TSAttachmentStream *attachment = [TSAttachmentStream fetchObjectWithUniqueID:attachmentID];
if (attachment == nil) { continue; }
[groupMessage addAttachmentWithKind:@"attachment" server:publicChat.server serverID:attachment.serverId contentType:attachment.contentType size:attachment.byteCount fileName:attachment.sourceFilename flags:0 width:@(attachment.imageSize.width).unsignedIntegerValue height:@(attachment.imageSize.height).unsignedIntegerValue caption:attachment.caption url:attachment.downloadURL linkPreviewURL:nil linkPreviewTitle:nil];
NSUInteger width = attachment.shouldHaveImageSize ? @(attachment.imageSize.width).unsignedIntegerValue : 0;
NSUInteger height = attachment.shouldHaveImageSize ? @(attachment.imageSize.height).unsignedIntegerValue : 0;
[groupMessage addAttachmentWithKind:@"attachment" server:publicChat.server serverID:attachment.serverId contentType:attachment.contentType size:attachment.byteCount fileName:attachment.sourceFilename flags:0 width:width height:height caption:attachment.caption url:attachment.downloadURL linkPreviewURL:nil linkPreviewTitle:nil];
}
[[LKPublicChatAPI sendMessage:groupMessage toGroup:publicChat.channel onServer:publicChat.server]
.thenOn(OWSDispatch.sendingQueue, ^(LKGroupMessage *groupMessage) {
Expand Down

0 comments on commit 984f732

Please sign in to comment.