From 1a3a0c6d4e34977729850ce201e399323a5fdfb8 Mon Sep 17 00:00:00 2001 From: uwaa Date: Wed, 18 Dec 2024 10:42:28 +0000 Subject: [PATCH] pleroma: move mention out --- Pleroma/Models/Mention.cs | 32 ++++++++++++++++++++++++++++++++ Pleroma/Models/Status.cs | 31 ------------------------------- 2 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 Pleroma/Models/Mention.cs diff --git a/Pleroma/Models/Mention.cs b/Pleroma/Models/Mention.cs new file mode 100644 index 0000000..54f195e --- /dev/null +++ b/Pleroma/Models/Mention.cs @@ -0,0 +1,32 @@ +namespace Uwaa.Pleroma; + +public class Mention +{ + public static implicit operator string(Mention mention) => mention.ID; + + /// + /// The webfinger acct: URI of the mentioned user. Equivalent to username for local users, or username@domain for remote users. + /// + [JsonPropertyName("acct")] + public string Account { get; set; } = null!; + + /// + /// The account id of the mentioned user + /// + [JsonPropertyName("id")] + public string ID { get; set; } = null!; + + /// + /// The location of the mentioned user's profile + /// + [JsonPropertyName("url")] + public string URL { get; set; } = null!; + + /// + /// The username of the mentioned user + /// + [JsonPropertyName("username")] + public string Username { get; set; } = null!; + + public override string ToString() => $"@{Account}"; +} diff --git a/Pleroma/Models/Status.cs b/Pleroma/Models/Status.cs index d3c6b9b..e702655 100644 --- a/Pleroma/Models/Status.cs +++ b/Pleroma/Models/Status.cs @@ -158,37 +158,6 @@ public class Status public override string ToString() => $"{Account?.Username ?? "unknown"}: \"{Content}\""; } -public class Mention -{ - public static implicit operator string(Mention mention) => mention.ID; - - /// - /// The webfinger acct: URI of the mentioned user. Equivalent to username for local users, or username@domain for remote users. - /// - [JsonPropertyName("acct")] - public string Account { get; set; } = null!; - - /// - /// The account id of the mentioned user - /// - [JsonPropertyName("id")] - public string ID { get; set; } = null!; - - /// - /// The location of the mentioned user's profile - /// - [JsonPropertyName("url")] - public string URL { get; set; } = null!; - - /// - /// The username of the mentioned user - /// - [JsonPropertyName("username")] - public string Username { get; set; } = null!; - - public override string ToString() => $"@{Account}"; -} - /// /// Additional pleroma-specific data for a . ///