Set restore timeout inactiv, this should be really an advanced option,
probably only set for specific MUCs not as default for every MUC.
Set restore_lines to 10, so the User has an indication that Gajim can
display history, and that there is probably a setting to adjust.
Set muc_restore_lines to 100, this is a try to get a reasonable amount
of history, especially in small Groupchats. Most server will limit this
to 20-50 anyway. The limit 100 is more of a precaution if we run into a
misconfigured server. This is intended as a workaround until we can
implement MAM for Groupchats.
muc_restore_timeout set to -1 means we want no particular time set, up
to which we request messages. But we should not deliberate request
messages we already have. Hence even if muc_restore_timeout is set
to -1, we should only request up to the last message we received.
Example:
If we receive a message the last message date is now.
If we restart Gajim and join the MUC again, `time.time() - timeout`
will be most likly smaller then when we received the last message
If the timeout is an hour, this would mean that many messages are requested
from the archive which we already received.
So we always want the most current timestamp (MAX).
Because some operations use the _timeout_commit() it happens that a timeout
is active while we shutdown.
This makes sure everything is commited before shutdown.
- remove gui extension point on close, to remove the reference the plugin manager holds to the Class.
- reduce scope of var that holds reference to Gtk.Builder(). We have to be careful with
Gtk.Builder, because it can hold a reference to our Class (methods bound to signals) which creates a reference cycle
which python is not able to detect. Hence neither Gtk.Builder nor our Class are garbage collected.
Why this is not detected as a reference cylce is unclear at the moment.
There are two approaches to circumvent the problem:
1. we lose our reference to Gtk.Builder when closing the window, which lets python garbage
collect the builder, afterwards it can garbage collect our class.
2. we reduce the scope of the var that holds a reference to Gtk.Builder, so that the builder
can be garbage collected at the end of __init__.
I chose to reduce the scope because the builder is not needed class wide.