aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/fallback_body.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2023-01-29 23:06:01 +0100
committerfiaxh <git@lightrise.org>2023-01-30 22:54:55 +0100
commitb0b81b88c6948dcfd2b1b82a9fe7357316a3af1f (patch)
treeea44aed7431b955ef8b1636f74c8ebe42bacb099 /libdino/src/service/fallback_body.vala
parent10a2bce5122dcd1e6fef037633a26568bf27d4d1 (diff)
downloaddino-b0b81b88c6948dcfd2b1b82a9fe7357316a3af1f.tar.gz
dino-b0b81b88c6948dcfd2b1b82a9fe7357316a3af1f.zip
Always display reaction+reply buttons, disable if not possible
Diffstat (limited to 'libdino/src/service/fallback_body.vala')
-rw-r--r--libdino/src/service/fallback_body.vala16
1 files changed, 16 insertions, 0 deletions
diff --git a/libdino/src/service/fallback_body.vala b/libdino/src/service/fallback_body.vala
index cc9ba9a6..13323427 100644
--- a/libdino/src/service/fallback_body.vala
+++ b/libdino/src/service/fallback_body.vala
@@ -64,4 +64,20 @@ public class Dino.FallbackBody : StreamInteractionModule, Object {
return false;
}
}
+
+ public static string get_quoted_fallback_body(ContentItem content_item) {
+ string fallback = "> ";
+
+ if (content_item.type_ == MessageItem.TYPE) {
+ Message? quoted_message = ((MessageItem) content_item).message;
+ fallback += Dino.message_body_without_reply_fallback(quoted_message);
+ fallback = fallback.replace("\n", "\n> ");
+ } else if (content_item.type_ == FileItem.TYPE) {
+ FileTransfer? quoted_file = ((FileItem) content_item).file_transfer;
+ fallback += quoted_file.file_name;
+ }
+ fallback += "\n";
+
+ return fallback;
+ }
} \ No newline at end of file