fix #93
This commit is contained in:
parent
2a65bdb08f
commit
089e297656
@ -714,12 +714,13 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String type=getActivity().getContentResolver().getType(uri);
|
String type=getActivity().getContentResolver().getType(uri);
|
||||||
if(instance.configuration!=null && instance.configuration.mediaAttachments!=null){
|
if(instance!=null && instance.configuration!=null && instance.configuration.mediaAttachments!=null){
|
||||||
if(instance.configuration.mediaAttachments.supportedMimeTypes!=null && !instance.configuration.mediaAttachments.supportedMimeTypes.contains(type)){
|
if(instance.configuration.mediaAttachments.supportedMimeTypes!=null && !instance.configuration.mediaAttachments.supportedMimeTypes.contains(type)){
|
||||||
showMediaAttachmentError(getString(R.string.media_attachment_unsupported_type, UiUtils.getFileName(uri)));
|
showMediaAttachmentError(getString(R.string.media_attachment_unsupported_type, UiUtils.getFileName(uri)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int sizeLimit=type.startsWith("image/") ? instance.configuration.mediaAttachments.imageSizeLimit : instance.configuration.mediaAttachments.videoSizeLimit;
|
if(!type.startsWith("image/")){
|
||||||
|
int sizeLimit=instance.configuration.mediaAttachments.videoSizeLimit;
|
||||||
int size;
|
int size;
|
||||||
try(Cursor cursor=MastodonApp.context.getContentResolver().query(uri, new String[]{OpenableColumns.SIZE}, null, null, null)){
|
try(Cursor cursor=MastodonApp.context.getContentResolver().query(uri, new String[]{OpenableColumns.SIZE}, null, null, null)){
|
||||||
cursor.moveToFirst();
|
cursor.moveToFirst();
|
||||||
@ -735,6 +736,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pollBtn.setEnabled(false);
|
pollBtn.setEnabled(false);
|
||||||
DraftMediaAttachment draft=new DraftMediaAttachment();
|
DraftMediaAttachment draft=new DraftMediaAttachment();
|
||||||
draft.uri=uri;
|
draft.uri=uri;
|
||||||
|
Loading…
Reference in New Issue
Block a user