diff --git a/src/Services/Accounts/InstanceAccount.vala b/src/Services/Accounts/InstanceAccount.vala index 7afe35fe..f18aa04a 100644 --- a/src/Services/Accounts/InstanceAccount.vala +++ b/src/Services/Accounts/InstanceAccount.vala @@ -14,6 +14,7 @@ public class Tuba.InstanceAccount : API.Account, Streamable { public const string KIND_FOLLOW_REQUEST = "follow_request"; public const string KIND_REMOTE_REBLOG = "__remote-reblog"; public const string KIND_EDITED = "update"; + public const string KIND_REPLY = "tuba_reply"; public string uuid { get; set; } public string? backend { set; get; } @@ -168,7 +169,7 @@ public class Tuba.InstanceAccount : API.Account, Streamable { } public virtual void describe_kind ( - string kind, + string? kind, out Kind result, string? actor_name = null, string? callback_url = null @@ -230,6 +231,13 @@ public class Tuba.InstanceAccount : API.Account, Streamable { null }; break; + case KIND_REPLY: + result = { + "tuba-reply-sender-symbolic", + _("In Reply"), + null + }; + break; default: result = { null, diff --git a/src/Views/Thread.vala b/src/Views/Thread.vala index db7c2e61..7880f974 100644 --- a/src/Views/Thread.vala +++ b/src/Views/Thread.vala @@ -207,6 +207,7 @@ public class Tuba.Views.Thread : Views.ContentBase, AccountHolder { widget_status.reply_cb = on_replied; widget_status.enable_thread_lines = true; widget_status.content.selectable = true; + widget_status.kind = null; if (((API.Status) obj).id == root_status.id) { #if !USE_LISTVIEW diff --git a/src/Widgets/Status.vala b/src/Widgets/Status.vala index f09f3f44..b451fcc6 100644 --- a/src/Widgets/Status.vala +++ b/src/Widgets/Status.vala @@ -205,8 +205,12 @@ status: status ); - if (kind == null && status.reblog != null) { - kind = InstanceAccount.KIND_REMOTE_REBLOG; + if (kind == null) { + if (status.reblog != null) { + kind = InstanceAccount.KIND_REMOTE_REBLOG; + } else if (status.in_reply_to_id != null || status.in_reply_to_account_id != null) { + kind = InstanceAccount.KIND_REPLY; + } } init_menu_button (); @@ -432,8 +436,10 @@ Tuba.InstanceAccount.Kind res_kind; accounts.active.describe_kind (this.kind, out res_kind, this.kind_instigator.display_name, this.kind_instigator.url); + if (header_button_activate > 0) header_button.disconnect (header_button_activate); if (res_kind.icon == null) { // status_box.margin_top = 18; + header_icon.visible = header_button.visible = false; return; }; @@ -471,9 +477,11 @@ header_label.label = res_kind.description; header_kind_url = res_kind.url; - if (header_button_activate > 0) header_button.disconnect (header_button_activate); - if (header_kind_url != null) + if (header_kind_url != null) { header_button_activate = header_button.clicked.connect (on_header_button_clicked); + } else { + header_button_activate = header_button.clicked.connect (on_open); + } } private void on_header_button_clicked () {