[fractal/fractal-next] event-actions: Implement Copy Emote



commit f43b1850fdc77d303d838c8d21547135e8326676
Author: Kirill Schmidt <kirill schmidt teckids org>
Date:   Sun Feb 13 00:35:40 2022 +0100

    event-actions: Implement Copy Emote

 src/session/room/event_actions.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/session/room/event_actions.rs b/src/session/room/event_actions.rs
index 32e27578..a4eeefba 100644
--- a/src/session/room/event_actions.rs
+++ b/src/session/room/event_actions.rs
@@ -163,6 +163,17 @@ where
                         })
                     );
                 }
+                MessageType::Emote(message) => {
+                    gtk_macros::action!(
+                        &action_group,
+                        "copy-text",
+                        clone!(@weak self as widget, @weak event => move |_, _| {
+                            let display_name = event.sender().display_name();
+                            let message = display_name + " " + &message.body;
+                            widget.clipboard().set_text(&message);
+                        })
+                    );
+                }
                 _ => {}
             }
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]