Skip to content

Commit

Permalink
refactor: clean up message notifications in handlers
Browse files Browse the repository at this point in the history
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
  • Loading branch information
amanji committed Jan 31, 2024
1 parent f9dd26f commit 1adfe8f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions rpc/rpc/v1_0/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ async def handle(self, context: RequestContext, responder: BaseResponder):
)
await storage.add_record(record)

await context.profile.notify(
"acapy::webhook::drpc_request",
{
"connection_id": connection_id,
"thread_id": thread_id,
"request": serialized_request_record,
},
)
notification = {
"connection_id": connection_id,
"thread_id": thread_id,
"request": serialized_request_record,
}

await context.profile.notify("drpc::request::received", notification)
await context.profile.notify("acapy::webhook::drpc_request", notification)


class DRPCResponseHandler(BaseHandler):
Expand Down Expand Up @@ -86,11 +86,11 @@ async def handle(self, context: RequestContext, responder: BaseResponder):
},
)

await context.profile.notify(
"acapy::webhook::drpc_response",
{
"connection_id": connection_id,
"thread_id": thread_id,
"response": serialized_response_record,
},
)
notification = {
"connection_id": connection_id,
"thread_id": thread_id,
"response": serialized_response_record,
}

await context.profile.notify("drpc::response::received", notification)
await context.profile.notify("acapy::webhook::drpc_response", notification)

0 comments on commit 1adfe8f

Please sign in to comment.