Skip to content

Commit 3834c88

Browse files
author
Rafael Diaz
committed
message_handler returns now the connection too and not only the message. That way after receiving a message, more messages can be sent back to the user as a reaction to that message or command
1 parent 19ba796 commit 3834c88

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,6 @@ gen
7474

7575
# MyPy Cache
7676
.mypy_cache/
77+
78+
# macos
79+
.DS_Store

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def callback(event_loop, connection):
558558
async def create_callback():
559559
queue = asyncio.Queue()
560560

561-
async def handle_message(message):
561+
async def handle_message(message, conn):
562562
await queue.put(message)
563563

564564
return Callback(queue, handle_message)

threema/gateway/e2e.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ async def handle_callback(context, request):
221221
raise CallbackError(400, str(exc)) from exc
222222

223223
# Pass message to handler
224-
await context.message_handler(message)
224+
await context.message_handler(message, context.connection)
225225

226226
# Respond with 'OK'
227227
return web.Response(status=200)

0 commit comments

Comments
 (0)