comparison sat/plugins/plugin_comp_ap_gateway/http_server.py @ 4023:78b5f356900c

component AP gateway: handle attachments
author Goffi <goffi@goffi.org>
date Thu, 23 Mar 2023 15:42:21 +0100
parents 97df34151c6d
children 524856bd7b19
comparison
equal deleted inserted replaced
4022:cdb7de398c85 4023:78b5f356900c
213 if subscription.state != "subscribed": 213 if subscription.state != "subscribed":
214 # other states should raise an Exception 214 # other states should raise an Exception
215 raise exceptions.InternalError('"subscribed" state was expected') 215 raise exceptions.InternalError('"subscribed" state was expected')
216 inbox = await self.apg.getAPInboxFromId(signing_actor, use_shared=False) 216 inbox = await self.apg.getAPInboxFromId(signing_actor, use_shared=False)
217 actor_id = self.apg.buildAPURL(TYPE_ACTOR, ap_account) 217 actor_id = self.apg.buildAPURL(TYPE_ACTOR, ap_account)
218 accept_data = self.apg.createActivity( 218 accept_data = self.apg.create_activity(
219 "Accept", actor_id, object_=data 219 "Accept", actor_id, object_=data
220 ) 220 )
221 await self.apg.signAndPost(inbox, actor_id, accept_data) 221 await self.apg.signAndPost(inbox, actor_id, accept_data)
222 await self.apg._c.synchronise(client, account_jid, node, resync=False) 222 await self.apg._c.synchronise(client, account_jid, node, resync=False)
223 223
713 ] 713 ]
714 else: 714 else:
715 ordered_items = [ 715 ordered_items = [
716 await self.apg.mb_data_2_ap_item( 716 await self.apg.mb_data_2_ap_item(
717 self.apg.client, 717 self.apg.client,
718 await self.apg._m.item2mbdata( 718 await self.apg._m.item_2_mb_data(
719 self.apg.client, 719 self.apg.client,
720 item, 720 item,
721 account_jid, 721 account_jid,
722 node 722 node
723 ) 723 )