ui: Send the room display name in the UnverifiedDevices signal.

This commit is contained in:
Damir Jelić 2019-05-21 12:31:58 +02:00
parent ff2fc7e448
commit ae85ec22bb
3 changed files with 29 additions and 4 deletions

View File

@ -26,7 +26,8 @@ from pantalaimon.thread_messages import (AcceptSasMessage, CancelSasMessage,
ExportKeysMessage, ImportKeysMessage,
SasMessage, StartSasMessage,
UpdateDevicesMessage,
UpdateUsersMessage)
UpdateUsersMessage,
UnverifiedDevicesSignal)
@attr.s
@ -678,7 +679,8 @@ class ProxyDaemon:
# The room is not in the joined rooms list, just forward it.
try:
encrypt = client.rooms[room_id].encrypted
room = client.rooms[room_id]
encrypt = room.encrypted
except KeyError:
return await self.forward_to_web(
request,
@ -727,7 +729,11 @@ class ProxyDaemon:
# the UI thread about this and wait for a response.
queue = asyncio.Queue()
message = UnverifiedDevicesSignal(client.user_id, room_id)
message = UnverifiedDevicesSignal(
client.user_id,
room_id,
room.display_name
)
await self.send_queue.put(message)
# TODO allow dbus clients to answer us here.

View File

@ -10,6 +10,7 @@ class Message:
class UnverifiedDevicesSignal(Message):
pan_user = attr.ib()
room_id = attr.ib()
room_display_name = attr.ib()
@attr.s

View File

@ -56,6 +56,16 @@ class Control:
<arg type='u' name='id' direction='out'/>
</method>
<method name='SendAnyways'>
<arg type='s' name='pan_user' direction='in'/>
<arg type='s' name='room_id' direction='in'/>
</method>
<method name='CancelSending'>
<arg type='s' name='pan_user' direction='in'/>
<arg type='s' name='room_id' direction='in'/>
</method>
<signal name="Response">
<arg direction="out" type="i" name="id"/>
<arg direction="out" type="s" name="pan_user"/>
@ -65,6 +75,7 @@ class Control:
<signal name="UnverifiedDevices">
<arg direction="out" type="s" name="pan_user"/>
<arg direction="out" type="s" name="room_id"/>
<arg direction="out" type="s" name="room_display_name"/>
</signal>
</interface>
@ -114,6 +125,12 @@ class Control:
self.queue.put(message)
return message.message_id
def SendAnyways(self, pan_user, room_id):
pass
def CancelSending(self, pan_user, room_id):
pass
class Devices:
"""
@ -394,7 +411,8 @@ class GlibT:
elif isinstance(message, UnverifiedDevicesSignal):
self.control_if.UnverifiedDevices(
message.pan_user,
message.room_id
message.room_id,
message.room_display_name
)
elif isinstance(message, InviteSasSignal):