GNOME Bugzilla – Bug 710271
Show channels and logs when offline or disconnected
Last modified: 2013-12-12 12:16:37 UTC
If polari isn't online or is in the process of connecting, you should still see the list of channels in the sidebar, and each channel should show the logs for recent conversations. We'd need to make the chat entry field insensitive and indicate that the channel is offline - perhaps by changing the channel icon to user-offline-symbolic.
Created attachment 264055 [details] [review] room: Add account, channel-name and type properties Currently the lifetime of a room is bound to the lifetime of the corresponding channel. This will soon change, and we will create a room as soon as the user requested it, and only destroy it when it has been closed explicitly. To do that, we will need other means to identify a room and associate it with the corresponding channel, so add account, name and type properties for that purpose. For now, those properties are read-only and derived from the channel, but they will soon be used as the primary identifying properties.
Created attachment 264056 [details] [review] Use new PolariRoom properties In preparation of supporting offline rooms, replace simple accesses to PolariRoom:channel with the newly added :account, :type and :channel-name properties.
Created attachment 264057 [details] [review] room: Stop using the channel's object path as ID We will still need a unique ID at all times when supporting rooms with no assiciated channel, so base the ID on the new :account, :type and :channel-name properties instead.
Created attachment 264058 [details] [review] Guard against PolariRoom:channel getting set/unset This cannot happen currently, as the lifecycle of Rooms is bound to the corresponding channel, but this is about to change. So adjust the code to not assume that any room has a valid channel at any time, but update state appropriately as channels go away or become available.
Created attachment 264059 [details] [review] room: Reset :channel property when channel is invalidated We will soon stop to automatically destroying a room when the associated channels is invalidated. In order to not require users to check for the validity of :channel in addition to its existance, just unset the property when the channel becomes invalid.
Created attachment 264060 [details] [review] Make new Room properties the primary way to identify a room Require :account, :channel-name and :type to be set at construction time and ensure that they match the passed in channel when setting the :channel property.
Created attachment 264061 [details] [review] chatroomManager: Stop tying rooms' lifecycle to their channels Currently rooms are created and destroyed as the corresponding channel becomes available or goes away. However this behavior can result in the application appearing sluggish when the time between user request and result takes too long, and it is plain wrong when no user interaction at all is involved (for instance when the network goes away). So instead, create rooms immediately when requested by the user, and keep them around until removed explicitly.
Attachment 264055 [details] pushed as c58e60f - room: Add account, channel-name and type properties Attachment 264056 [details] pushed as e890b32 - Use new PolariRoom properties Attachment 264057 [details] pushed as 2f9f666 - room: Stop using the channel's object path as ID Attachment 264058 [details] pushed as 17bd1ea - Guard against PolariRoom:channel getting set/unset Attachment 264059 [details] pushed as 45f83ea - room: Reset :channel property when channel is invalidated Attachment 264060 [details] pushed as f7e080f - Make new Room properties the primary way to identify a room Attachment 264061 [details] pushed as f6b73e8 - chatroomManager: Stop tying rooms' lifecycle to their channels
Fantastic! Thanks Florian; this looks like it was a fair amount of work.