aboutsummaryrefslogtreecommitdiff
path: root/azalea-chat/src/events.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-12-15 23:10:55 -0600
committermat <github@matdoes.dev>2021-12-15 23:10:55 -0600
commit9642558f8f8d983a7087f15d68be8cf07a85f0c2 (patch)
tree5f0a967f005cd5db510a13ab290c8ad6669b25aa /azalea-chat/src/events.rs
parent72aefe871ca4983431b1a0b707b472e73ffea836 (diff)
downloadazalea-drasl-9642558f8f8d983a7087f15d68be8cf07a85f0c2.tar.xz
azalea
Diffstat (limited to 'azalea-chat/src/events.rs')
-rw-r--r--azalea-chat/src/events.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/azalea-chat/src/events.rs b/azalea-chat/src/events.rs
new file mode 100644
index 00000000..a547169e
--- /dev/null
+++ b/azalea-chat/src/events.rs
@@ -0,0 +1,26 @@
+enum ClickAction {
+ OPEN_URL = Action::new("open_url", true),
+ OPEN_FILE = Action::new("open_file", false),
+ RUN_COMMAND = Action::new("run_command", true),
+ SUGGEST_COMMAND = Action::new("suggest_command", true),
+ CHANGE_PAGE = Action::new("change_page", true),
+ COPY_TO_CLIPBOARD = Action::new("copy_to_clipboard", true),
+}
+
+struct ClickAction {
+ pub name: String,
+ pub allow_from_server: bool,
+}
+
+impl ClickAction {
+ fn new(name: &str, allow_from_server: bool) -> Self {
+ Self {
+ name: name.to_string(),
+ allow_from_server,
+ }
+ }
+}
+
+struct ClickEvent {
+ action: ClickAction,
+}