|
|
@ -81,8 +81,8 @@ failed:
|
|
|
|
|
|
|
|
|
|
|
|
bool account_sync_from_activity( struct account* a, struct ap_object* obj )
|
|
|
|
bool account_sync_from_activity( struct account* a, struct ap_object* obj )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( obj->url ) {
|
|
|
|
if( obj->url.count > 0 ) {
|
|
|
|
a->account_url = strdup(obj->url);
|
|
|
|
a->account_url = strdup(obj->url.items[0].ref); // TODO: make this more robust
|
|
|
|
} else if( obj->id ) {
|
|
|
|
} else if( obj->id ) {
|
|
|
|
a->account_url = strdup(obj->id);
|
|
|
|
a->account_url = strdup(obj->id);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -106,12 +106,12 @@ bool account_sync_from_activity( struct account* a, struct ap_object* obj )
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
a->display_name = strdup(obj->preferred_username);
|
|
|
|
a->display_name = strdup(obj->preferred_username);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( obj->icon && obj->icon->url ) {
|
|
|
|
if( obj->icon && obj->icon->url.count > 0 ) {
|
|
|
|
a->avatar.url = strdup(obj->icon->url);
|
|
|
|
a->avatar.url = strdup(obj->icon->url.items[0].ref); // TODO: make this more robust
|
|
|
|
a->avatar.static_url = strdup(a->avatar.url);
|
|
|
|
a->avatar.static_url = strdup(a->avatar.url);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( obj->image && obj->image->url ) {
|
|
|
|
if( obj->image && obj->image->url.count > 0 ) {
|
|
|
|
a->banner = strdup(obj->image->url);
|
|
|
|
a->banner = strdup(obj->image->url.items[0].ref); // TODO: make this more robust
|
|
|
|
}
|
|
|
|
}
|
|
|
|
a->bot = ( obj->type != ap_Person );
|
|
|
|
a->bot = ( obj->type != ap_Person );
|
|
|
|
a->account_type = at_remote_activity_pub;
|
|
|
|
a->account_type = at_remote_activity_pub;
|
|
|
|