Mercurial > libervia-backend
comparison sat/plugins/plugin_comp_ap_gateway/pubsub_service.py @ 4023:78b5f356900c
component AP gateway: handle attachments
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 23 Mar 2023 15:42:21 +0100 |
parents | 0aa7023dcd08 |
children | 524856bd7b19 |
comparison
equal
deleted
inserted
replaced
4022:cdb7de398c85 | 4023:78b5f356900c |
---|---|
512 # account | 512 # account |
513 req_actor_id, recip_actor_id, inbox = await self.getAPActorIdsAndInbox( | 513 req_actor_id, recip_actor_id, inbox = await self.getAPActorIdsAndInbox( |
514 requestor, service | 514 requestor, service |
515 ) | 515 ) |
516 | 516 |
517 data = self.apg.createActivity("Follow", req_actor_id, recip_actor_id) | 517 data = self.apg.create_activity("Follow", req_actor_id, recip_actor_id) |
518 | 518 |
519 resp = await self.apg.signAndPost(inbox, req_actor_id, data) | 519 resp = await self.apg.signAndPost(inbox, req_actor_id, data) |
520 if resp.code >= 300: | 520 if resp.code >= 300: |
521 text = await resp.text() | 521 text = await resp.text() |
522 raise error.StanzaError("service-unavailable", text=text) | 522 raise error.StanzaError("service-unavailable", text=text) |
525 @ensure_deferred | 525 @ensure_deferred |
526 async def unsubscribe(self, requestor, service, nodeIdentifier, subscriber): | 526 async def unsubscribe(self, requestor, service, nodeIdentifier, subscriber): |
527 req_actor_id, recip_actor_id, inbox = await self.getAPActorIdsAndInbox( | 527 req_actor_id, recip_actor_id, inbox = await self.getAPActorIdsAndInbox( |
528 requestor, service | 528 requestor, service |
529 ) | 529 ) |
530 data = self.apg.createActivity( | 530 data = self.apg.create_activity( |
531 "Undo", | 531 "Undo", |
532 req_actor_id, | 532 req_actor_id, |
533 self.apg.createActivity( | 533 self.apg.create_activity( |
534 "Follow", | 534 "Follow", |
535 req_actor_id, | 535 req_actor_id, |
536 recip_actor_id | 536 recip_actor_id |
537 ) | 537 ) |
538 ) | 538 ) |