Support custom account fields

This commit is contained in:
bleakgrey 2018-05-18 00:27:44 +03:00
parent 560ae523a8
commit fbdfb5ea27
1 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,17 @@ public class Tootle.Account{
account.followers_count = obj.get_int_member ("followers_count");
account.following_count = obj.get_int_member ("following_count");
account.statuses_count = obj.get_int_member ("statuses_count");
if (obj.has_member ("fields")) {
obj.get_array_member ("fields").foreach_element ((array, i, node) => {
var field_obj = node.get_object ();
var field_name = field_obj.get_string_member ("name");
var field_val = field_obj.get_string_member ("value");
account.note += "\n";
account.note += field_name + ": ";
account.note += field_val;
});
}
return account;
}