From eb9a5c7d466d048f5d410e5dbc63dea030d0a094 Mon Sep 17 00:00:00 2001 From: Anna Date: Sun, 4 Sep 2022 01:23:44 -0400 Subject: [PATCH] asuh --- client/Ui/Viewer.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/client/Ui/Viewer.cs b/client/Ui/Viewer.cs index 1880ce2..9a46aff 100644 --- a/client/Ui/Viewer.cs +++ b/client/Ui/Viewer.cs @@ -1,6 +1,7 @@ using System.Numerics; using Dalamud.Interface; using ImGuiNET; +using OrangeGuidanceTomestone.Helpers; namespace OrangeGuidanceTomestone.Ui; @@ -72,6 +73,32 @@ internal class Viewer { ImGui.PushTextWrapPos(); ImGui.TextUnformatted(message.Text); ImGui.PopTextWrapPos(); + + if (ImGui.Button("Like")) { + Task.Run(async () => { + await ServerHelper.SendRequest( + this.Plugin.Config.ApiKey, + HttpMethod.Patch, + $"/messages/{message.Id}/votes", + null, + new StringContent("1") + ); + }); + } + + ImGui.SameLine(); + + if (ImGui.Button("Dislike")) { + Task.Run(async () => { + await ServerHelper.SendRequest( + this.Plugin.Config.ApiKey, + HttpMethod.Patch, + $"/messages/{message.Id}/votes", + null, + new StringContent("-1") + ); + }); + } } if (ImGui.TableSetColumnIndex(2)) {