diff --git a/client/Message.cs b/client/Message.cs index 0258488..eaa20cf 100644 --- a/client/Message.cs +++ b/client/Message.cs @@ -30,6 +30,7 @@ internal class Message { internal class MessageWithTerritory { public Guid Id { get; init; } public uint Territory { get; init; } + public uint? Ward { get; init; } public float X { get; init; } public float Y { get; init; } public float Z { get; init; } diff --git a/client/Ui/MainWindowTabs/MessageList.cs b/client/Ui/MainWindowTabs/MessageList.cs index 3e66742..c7bb790 100644 --- a/client/Ui/MainWindowTabs/MessageList.cs +++ b/client/Ui/MainWindowTabs/MessageList.cs @@ -74,9 +74,14 @@ internal class MessageList : ITab { var territory = this.Plugin.DataManager.GetExcelSheet()?.GetRow(message.Territory); var territoryName = territory?.PlaceName.Value?.Name?.ToDalamudString().TextValue ?? "???"; + var loc = $"Location: {territoryName}"; + if (message.Ward != null) { + loc += $" (Ward {message.Ward.Value})"; + } + ImGui.TextUnformatted(message.Text); ImGui.TreePush(); - ImGui.TextUnformatted($"Location: {territoryName}"); + ImGui.TextUnformatted(loc); ImGui.SameLine(); if (ImGuiHelper.SmallIconButton(FontAwesomeIcon.MapMarkerAlt, $"{message.Id}") && territory != null) { diff --git a/server/src/web.rs b/server/src/web.rs index edb4042..9e23e4c 100644 --- a/server/src/web.rs +++ b/server/src/web.rs @@ -95,7 +95,7 @@ async fn handle_rejection(err: Rejection) -> Result { WebError::NoSuchMessage => (StatusCode::NOT_FOUND, "no_such_message", "no message with that id was found".into()), WebError::InvalidExtraCode => (StatusCode::BAD_REQUEST, "invalid_extra_code", "that extra code was not found".into()), WebError::MissingWard => (StatusCode::BAD_REQUEST, "missing_ward", "a ward was not provided - try updating the plugin".into()), - WebError::UnnecessaryWard => (StatusCode::BAD_REQUEST, "unnecessar_ward", "a ward was provided but not necessary - try updating the plugin".into()), + WebError::UnnecessaryWard => (StatusCode::BAD_REQUEST, "unnecessary_ward", "a ward was provided but not necessary - try updating the plugin".into()), } } else if err.is_not_found() { (StatusCode::NOT_FOUND, "not_found", "route was unknown to the server".into()) diff --git a/server/src/web/get_location.rs b/server/src/web/get_location.rs index 327be87..6528b64 100644 --- a/server/src/web/get_location.rs +++ b/server/src/web/get_location.rs @@ -39,7 +39,7 @@ async fn logic(state: Arc, id: i64, location: u32, query: GetLocationQuer if !housing && query.ward.is_some() { return Err(warp::reject::custom(WebError::UnnecessaryWard)); } - + let location = location as i64; let mut messages = sqlx::query_as!( RetrievedMessage, @@ -62,7 +62,7 @@ async fn logic(state: Arc, id: i64, location: u32, query: GetLocationQuer left join votes v on m.id = v.message left join votes v2 on m.id = v2.message and v2.user = ? inner join users u on m.user = u.id - where m.territory = ? and m.ward = ? + where m.territory = ? and m.ward is ? group by m.id"#, id, location,