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

Can delete a conversation from the list of conversations

This commit is contained in:
2019-05-01 10:52:10 +02:00
parent fcc8c2faa4
commit db02a41b75
3 changed files with 80 additions and 2 deletions

View File

@ -51,7 +51,7 @@ class ConversationsHelper {
});
// Update all conversation settings, if possible
if(settings.isOwner) {
if (settings.isOwner) {
request.addString("name", settings.hasName ? settings.name : "false");
request.addString("members", settings.members.join(","));
}
@ -61,6 +61,19 @@ class ConversationsHelper {
return response.code == 200;
}
/// Delete a conversation specified by its [id]
Future<bool> deleteConversation(int id) async {
final response = await APIRequest(
uri: "conversations/delete",
needLogin: true,
args: {
"conversationID": id.toString(),
},
).exec();
return response.code == 200;
}
/// Download the list of conversations from the server
Future<ConversationsList> downloadList() async {
final response =