From 9be25a5d61fab8f6b0694253135289c014efce5e Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 9 Mar 2016 15:50:01 +0100 Subject: [PATCH] Remove unused UnsignedEventData class It is now implemented in Matrix.Event.Room --- src/matrix-compacts.vala | 74 ---------------------------------------- 1 file changed, 74 deletions(-) diff --git a/src/matrix-compacts.vala b/src/matrix-compacts.vala index 6f41488..31341f0 100644 --- a/src/matrix-compacts.vala +++ b/src/matrix-compacts.vala @@ -542,80 +542,6 @@ namespace Matrix { } } - /** - * Class to hold unsigned event data, like event age, redact - * reason or a transaction ID. - */ - public class UnsignedEventData : JsonCompact { - /** - * The age of the event, in seconds. - */ - public uint age { get; set; default = 0; } - - /** - * The reason of redaction, if any. - */ - public string? redact_reason { get; set; default = null; } - - /** - * The transaction ID of the message. - */ - public string? transaction_id { get; set; default = null; } - - /** - * Create an UnsignedEventData object based - * on @param json_data. - */ - public - UnsignedEventData.from_json(Json.Node json_data) - requires(json_data.get_node_type() == Json.NodeType.OBJECT) - { - var root = json_data.get_object(); - Json.Node node; - - if ((node = root.get_member("age")) != null) { - age = (uint)node.get_int(); - } - - if ((node = root.get_member("redacted_because")) != null) { - redact_reason = node.get_string(); - } - - if ((node = root.get_member("transaction_id")) != null) { - transaction_id = node.get_string(); - } - } - - /** - * Get the unsigned event data as a JSON node. - */ - public override Json.Node? - get_json_node() - throws Matrix.Error - { - var builder = new Json.Builder(); - - builder.begin_object(); - - builder.set_member_name("age"); - builder.add_int_value(age); - - if (redact_reason != null) { - builder.set_member_name("redacted_because"); - builder.add_string_value(redact_reason); - } - - if (transaction_id != null) { - builder.set_member_name("transaction_id"); - builder.add_string_value(transaction_id); - } - - builder.end_object(); - - return builder.get_root(); - } - } - public class EventContext : JsonCompact { public int? before_limit { get; set; default = null; } public int? after_limit { get; set; default = null; }