1
0
Fork 0

Resolve miscellaneous TODOS

Fixes #2
This commit is contained in:
Mouse Reeve 2020-02-10 22:10:05 -08:00
parent 55f5735b33
commit 0f1240ca1f
3 changed files with 9 additions and 9 deletions

View file

@ -6,6 +6,7 @@ from Crypto.Hash import SHA256
from datetime import datetime
import json
import requests
from urllib.parse import urlparse
from fedireads import models
from fedireads import incoming
@ -32,7 +33,8 @@ def get_or_create_remote_user(actor):
# the webfinger format for the username.
# TODO: get the user's domain in a better way
username = '%s@%s' % (actor.split('/')[-1], actor.split('/')[2])
actor_parts = urlparse(actor)
username = '%s@%s' % (actor_parts.path.split('/')[-1], actor_parts.netloc)
shared_inbox = data.get('endpoints').get('sharedInbox') if \
data.get('endpoints') else None