Skip to content

Commit

Permalink
remove unnecessary code change
Browse files Browse the repository at this point in the history
  • Loading branch information
alphatownsman committed Sep 13, 2023
1 parent a481536 commit eac6158
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
8 changes: 1 addition & 7 deletions activities/models/post_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from core.snowflake import Snowflake
from stator.models import State, StateField, StateGraph, StatorModel
from users.models.identity import Identity
from users.models.relay_actor import RelayActor


class PostInteractionStates(StateGraph):
Expand Down Expand Up @@ -299,11 +298,6 @@ def to_ap(self) -> dict:
"object": self.post.object_uri,
"to": "as:Public",
}
if self.identity.is_local_relay:
# if boost to relay, set "to" to remote relays instead of Public
value["to"] = list(
RelayActor.get_relays().values_list("actor_uri", flat=True)
)
elif self.type == self.Types.like:
value = {
"type": "Like",
Expand All @@ -321,7 +315,7 @@ def to_ap(self) -> dict:
"inReplyTo": self.post.object_uri,
"attributedTo": self.identity.actor_uri,
}
else:
elif self.type == self.Types.pin:
raise ValueError("Cannot turn into AP")
return value

Expand Down
1 change: 0 additions & 1 deletion templates/admin/identities.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
Remote
<small>{{ identity.followers_count }} local follower{{ identity.followers_count|pluralize }}</small>
{% endif %}
{{ identity.actor_type }}
</td>
<td class="actions">
<a href="{{ identity.urls.admin_edit }}" title="View"><i class="fa-solid fa-eye"></i></a>
Expand Down
6 changes: 1 addition & 5 deletions users/models/follow.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,7 @@ def create_local(cls, source, target, boosts=True):
uri="",
state=FollowStates.unrequested,
)
follow.uri = (
source.actor_uri
+ ("/" if source.actor_uri[-1] != "/" else "")
+ f"follow/{follow.pk}/"
)
follow.uri = source.actor_uri + f"follow/{follow.pk}/"
follow.save()
return follow

Expand Down
5 changes: 0 additions & 5 deletions users/models/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
)
from stator.models import State, StateField, StateGraph, StatorModel
from users.models.domain import Domain
from users.models.relay_actor import RelayActor
from users.models.system_actor import SystemActor


Expand Down Expand Up @@ -338,10 +337,6 @@ def safe_metadata(self):
for data in self.metadata
]

@property
def is_local_relay(self):
return self.local and self.actor_uri == RelayActor.actor_uri

def ensure_uris(self):
"""
Ensures that local identities have all the URIs populated on their fields
Expand Down

0 comments on commit eac6158

Please sign in to comment.