From be2d01a1e7a07dff7d18be2525d9a32a7e64bad3 Mon Sep 17 00:00:00 2001 From: otsmr Date: Fri, 31 Jan 2025 23:14:09 +0100 Subject: [PATCH] remove unused code --- lib/main.dart | 2 -- lib/src/model/messages_model.dart | 4 ++++ lib/src/providers/api_provider.dart | 1 - lib/src/views/chat_item_details_view.dart | 2 -- lib/src/views/chat_list_view.dart | 1 - 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index b148cab..044ae45 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,4 @@ import 'package:flutter/foundation.dart'; -import 'package:hive/hive.dart'; -import 'package:path_provider/path_provider.dart'; import 'package:provider/provider.dart'; import 'package:twonly/src/providers/api/api.dart'; import 'package:twonly/src/providers/api_provider.dart'; diff --git a/lib/src/model/messages_model.dart b/lib/src/model/messages_model.dart index 221f7b5..a5dd08b 100644 --- a/lib/src/model/messages_model.dart +++ b/lib/src/model/messages_model.dart @@ -36,6 +36,10 @@ class DbMessage { bool containsOtherMedia() { if (messageOtherId == null) return false; + return isMedia(); + } + + bool isMedia() { return messageKind == MessageKind.image || messageKind == MessageKind.video; } diff --git a/lib/src/providers/api_provider.dart b/lib/src/providers/api_provider.dart index d12aab7..c65f448 100644 --- a/lib/src/providers/api_provider.dart +++ b/lib/src/providers/api_provider.dart @@ -261,7 +261,6 @@ class ApiProvider { } Future triggerDownload(List token, int offset) async { - log.info("Offset: ${offset}"); var get = ApplicationData_DownloadData() ..uploadToken = token ..offset = offset; diff --git a/lib/src/views/chat_item_details_view.dart b/lib/src/views/chat_item_details_view.dart index 1bed225..94bcf79 100644 --- a/lib/src/views/chat_item_details_view.dart +++ b/lib/src/views/chat_item_details_view.dart @@ -1,5 +1,4 @@ import 'dart:collection'; - import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; @@ -8,7 +7,6 @@ import 'package:twonly/src/model/contacts_model.dart'; import 'package:twonly/src/model/json/message.dart'; import 'package:twonly/src/model/messages_model.dart'; import 'package:twonly/src/providers/api/api.dart'; -import 'package:twonly/src/providers/download_change_provider.dart'; import 'package:twonly/src/providers/messages_change_provider.dart'; import 'package:twonly/src/views/media_viewer_view.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; diff --git a/lib/src/views/chat_list_view.dart b/lib/src/views/chat_list_view.dart index b222e0e..2df6caa 100644 --- a/lib/src/views/chat_list_view.dart +++ b/lib/src/views/chat_list_view.dart @@ -7,7 +7,6 @@ import 'package:twonly/src/model/contacts_model.dart'; import 'package:twonly/src/model/messages_model.dart'; import 'package:twonly/src/providers/api/api.dart'; import 'package:twonly/src/providers/contacts_change_provider.dart'; -import 'package:twonly/src/providers/download_change_provider.dart'; import 'package:twonly/src/providers/messages_change_provider.dart'; import 'package:twonly/src/utils/misc.dart'; import 'package:twonly/src/views/chat_item_details_view.dart';