Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Afficher un message d'alerte avant envoi d'une pièce jointe trop lourde #1016

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Riot/Modules/Room/RoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7770,6 +7770,15 @@ - (void)documentPickerPresenter:(MXKDocumentPickerPresenter *)presenter didPickD
{
self.documentPickerPresenter = nil;

// Tchap: check maxUploadSize accepted by the home server before trying to upload.
NSUInteger maxUploadFileSize = self.roomDataSource.mxSession.maxUploadSize;
NSDictionary *fileAttributes = [NSFileManager.defaultManager attributesOfItemAtPath:url.path error:nil];
if (fileAttributes && fileAttributes.fileSize > maxUploadFileSize) {
[self showAlertWithTitle:TchapL10n.roomSendFileTooBigTitle
message:[TchapL10n roomSendFileTooBigMessage:maxUploadFileSize/(1024*1024) :fileAttributes.fileSize/(1024*1024)]];
return;
}

MXKUTI *fileUTI = [[MXKUTI alloc] initWithLocalFileURL:url];
NSString *mimeType = fileUTI.mimeType;

Expand Down
5 changes: 5 additions & 0 deletions Tchap/Assets/Localizations/fr.lproj/Tchap.strings
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@
"security_cross_signing_reset_message" = "Faites cette opération seulement si vous avez perdu tous vos autres appareils vérifiés.";
"security_cross_signing_reset_action_title" = "Réinitialiser";

////////////////////////////////////////////////////////////////////////////////
// MARK: Room send file
"room_send_file_too_big_title" = "Erreur d'envoi";
"room_send_file_too_big_message" = "Le fichier est trop lourd pour être envoyé. La taille limite est de %ldMo, mais la taille de votre fichier est de %ldMo.";

////////////////////////////////////////////////////////////////////////////////
// MARK: VoIP
"event_formatter_report_incident" = "Signaler un problème";
Expand Down
1 change: 1 addition & 0 deletions changelog.d/1015.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Afficher un message d'alerte avant envoi d'une pièce jointe trop lourde.
Loading