1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Can upload new custom emojies

This commit is contained in:
2020-04-29 13:42:01 +02:00
parent e6df696077
commit 225df61aa0
5 changed files with 162 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import 'package:comunic/enums/user_page_visibility.dart';
import 'package:comunic/models/account_image_settings.dart';
import 'package:comunic/models/api_request.dart';
import 'package:comunic/models/general_settings.dart';
import 'package:comunic/models/new_emoji.dart';
/// Settings helper
///
@ -123,4 +124,14 @@ class SettingsHelper {
(await APIRequest(uri: "settings/delete_account_image", needLogin: true)
.exec())
.isOK;
/// Upload a new emoji
static Future<void> uploadNewCustomEmoji(NewEmoji newEmoji) async =>
(await APIRequest(
uri: "settings/upload_custom_emoji",
needLogin: true,
args: {"shortcut": newEmoji.shortcut})
.addFile("image", newEmoji.image)
.execWithFiles())
.assertOk();
}

View File

@ -73,7 +73,8 @@ class UsersHelper {
/// of failure
Future<UsersList> getListWithThrow(Set<int> users,
{bool forceDownload = false}) async {
final list = await getUsersInfo(users.toList());
final list =
await getUsersInfo(users.toList(), forceDownload: forceDownload);
if (list == null)
throw Exception(