mirror of
https://github.com/RoboSats/robosats.git
synced 2024-08-17 18:00:36 +03:00
Fix missing maker/taker in chatroom when first peers is WS and second is REST
This commit is contained in:
parent
88cd6d25b6
commit
82e4be8084
@ -36,6 +36,8 @@ class ChatRoomConsumer(AsyncWebsocketConsumer):
|
|||||||
defaults={
|
defaults={
|
||||||
"maker": self.user,
|
"maker": self.user,
|
||||||
"maker_connected": True,
|
"maker_connected": True,
|
||||||
|
"taker": order.taker,
|
||||||
|
"taker_connected": True,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -47,6 +49,8 @@ class ChatRoomConsumer(AsyncWebsocketConsumer):
|
|||||||
defaults={
|
defaults={
|
||||||
"taker": self.user,
|
"taker": self.user,
|
||||||
"taker_connected": True,
|
"taker_connected": True,
|
||||||
|
"maker": order.maker,
|
||||||
|
"maker_connected": False,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ class ChatView(viewsets.ViewSet):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
# Poor idea: is_peer_connected() mockup. Update connection status based on last time a GET request was sent
|
# is_peer_connected() mockup. Update connection status based on last time a GET request was sent
|
||||||
if chatroom.maker == request.user:
|
if chatroom.maker == request.user:
|
||||||
chatroom.taker_connected = order.taker.last_login > (
|
chatroom.taker_connected = order.taker.last_login > (
|
||||||
timezone.now() - timedelta(minutes=1)
|
timezone.now() - timedelta(minutes=1)
|
||||||
|
Loading…
Reference in New Issue
Block a user