aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-30 01:40:50 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-30 01:40:50 +0100
commit4afa53a8bb6b02c07db8c54362311c21444a3ced (patch)
tree2d2fb505b9b6c42b0307face4d7fa2536f890e00 /src/plugins
parentb89e704fdf28cdd02bea0b4cd12333bd99c0f3b5 (diff)
Matrix: remove upload limit check if server returns error, allow @ in username in login but remove it
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 2452548..688e16e 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -4877,13 +4877,8 @@ namespace QuickMedia {
filename = file_get_filename(filepath);
int64_t upload_limit;
- PluginResult config_result = get_config(&upload_limit);
- if(config_result != PluginResult::OK) {
- err_msg = "Failed to get file size limit from server";
- return config_result;
- }
-
- if(file_analyzer.get_file_size() > upload_limit) {
+ PluginResult config_result = get_config(&upload_limit); // get_config can fail sometimes??? happened on plan9.rocks, why? is /r0/config optional?
+ if(config_result == PluginResult::OK && file_analyzer.get_file_size() > upload_limit) {
err_msg = "File is too large! max upload size on your homeserver is " + std::to_string((double)upload_limit / 1024.0 / 1024.0) + " mb, the file you tried to upload is " + std::to_string((double)file_analyzer.get_file_size() / 1024.0 / 1024.0) + " mb";
return PluginResult::ERR;
}