2018-10-27 08:29:25 +00:00
|
|
|
using GLib;
|
|
|
|
|
2019-03-11 14:14:37 +00:00
|
|
|
public class Tootle.API.Relationship : Object {
|
2018-04-30 17:56:02 +00:00
|
|
|
|
|
|
|
public int64 id;
|
|
|
|
public bool following;
|
|
|
|
public bool followed_by;
|
|
|
|
public bool blocking;
|
|
|
|
public bool muting;
|
|
|
|
public bool muting_notifications;
|
|
|
|
public bool requested;
|
|
|
|
public bool domain_blocking;
|
|
|
|
|
2018-10-27 08:29:25 +00:00
|
|
|
public Relationship (int64 _id) {
|
2018-10-23 10:05:24 +00:00
|
|
|
id = _id;
|
2018-04-30 17:56:02 +00:00
|
|
|
}
|
2019-03-11 14:14:37 +00:00
|
|
|
|
2018-10-27 08:29:25 +00:00
|
|
|
public static Relationship parse (Json.Object obj) {
|
2018-04-30 17:56:02 +00:00
|
|
|
var id = int64.parse (obj.get_string_member ("id"));
|
|
|
|
var relationship = new Relationship (id);
|
|
|
|
relationship.following = obj.get_boolean_member ("following");
|
|
|
|
relationship.followed_by = obj.get_boolean_member ("followed_by");
|
|
|
|
relationship.blocking = obj.get_boolean_member ("blocking");
|
|
|
|
relationship.muting = obj.get_boolean_member ("muting");
|
|
|
|
relationship.muting_notifications = obj.get_boolean_member ("muting_notifications");
|
|
|
|
relationship.requested = obj.get_boolean_member ("requested");
|
|
|
|
relationship.domain_blocking = obj.get_boolean_member ("domain_blocking");
|
|
|
|
return relationship;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|