lib/social_stream/ostatus/models/tie.rb in social_stream-ostatus-0.1.0 vs lib/social_stream/ostatus/models/tie.rb in social_stream-ostatus-0.2.0

- old
+ new

@@ -4,19 +4,20 @@ module Tie extend ActiveSupport::Concern module ClassMethods # Create a new {Tie} from OStatus entry - def from_entry! entry, receiver - # Sender must be remote - sender = RemoteSubject.find_or_create_by_webfinger_uri! entry.author.uri + def create_from_entry! entry, receiver + contact = ::Contact.from_entry! entry, receiver + + contact.relation_ids = [::Relation::Public.instance.id] + end - contact = sender.contact_to!(receiver) + # Remove all {Tie} from OStatus entry + def destroy_from_entry! entry, receiver + contact = ::Contact.from_entry! entry, receiver - # FIXME: hack - contact.user_author = sender - - contact.relation_ids = [::Relation::Public.instance.id] + contact.relation_ids = [] end end end end end