Commit Graph

14487 Commits

Author SHA1 Message Date
Philipp Hörist 9feee7d9dc Refactor get_room_last_message_time()
- Refactor get_last_date_that_has_logs()

- use NATURAL JOIN in SQL query instead of multiple SELECT via
_build_contact_where

- make code more concise

- update method documentation
2017-07-21 16:58:04 +02:00
Philipp Hörist 1e380473cd Refactor get_days_with_logs()
- use NATURAL JOIN in SQL query instead of multiple SELECT via
_build_contact_where

- make code more concise

- update method documentation
2017-07-21 16:58:04 +02:00
Philipp Hörist fb7eb0718a Refactor search_log()
- use NATURAL JOIN in SQL query instead of multiple SELECT via
_build_contact_where

- make code more concise

- update method documentation
2017-07-21 16:58:04 +02:00
Philipp Hörist 950f763220 Refactor get_conversation_for_date()
- use NATURAL JOIN in SQL query instead of multiple SELECT via
_build_contact_where

- make code more concise

- update method documentation

- Fix a bug where messages were displayed in wrong order when
they had the same timestamp
2017-07-21 16:58:04 +02:00
Philipp Hörist 40ba449f47 Refactor get_last_conversation_lines()
- use NATURAL JOIN in SQL query instead of multiple SELECT via
_build_contact_where

- make code more concise

- update method documentation
2017-07-21 16:58:04 +02:00
Philipp Hörist 5e63461e6d Update README 2017-07-20 19:14:51 +02:00
Philipp Hörist 96cbed4fe7 Remove redundant source_remove()
We remove the source in _schedule_activity_timers()
2017-07-20 01:58:41 +02:00
Philipp Hörist 5e1e4e27e7 Fix multiple metacontact requests at startup
_continue_connection_request_privacy() should only trigger
once after we received the discoinfo on the hostname.

We do a discoinfo on all items that the server offers,
_continue_connection_request_privacy() was triggered on every received
discoinfo again, hence requesting metacontacts and delimiters again.

also _continue_connection_request_privacy() was called on every
discoinfo error, instead of only on a hostname discoinfo error.

This bug is only triggered if the server doesnt support privacy rules.
2017-07-20 01:58:08 +02:00
Philipp Hörist a754c05979 Fix discovery of MAM 2017-07-19 20:19:40 +02:00
Philipp Hörist 47c33bbe39 Play sounds on MacOS 2017-07-19 13:16:27 +02:00
Philipp Hörist cdc2ec9205 Fix not requesting roster on empty cache.db
The purpose of

`if version and not gajim.contacts.get_contacts_jid_list()`

seemed to be that when cache.db is empty (maybe it was deleted)
`gajim.contacts.get_contacts_jid_list()` should come back empty.

So on an empty roster cache, version was set to None, so that we
request in any case a new roster.

The Problem is that `gajim.contacts.get_contacts_jid_list()` is not
a good indication for an empty cache.db. On start we trigger a
`RosterReceivedEvent` which does a DB query to get the roster. Even
if that DB query comes up empty, the Event is still pushed.

In the event handler `_nec_roster_received` in roster_window.py we
add then previously open controls and our self (if the option is set)
to the roster, making `gajim.contacts.get_contacts_jid_list()` return
these contacts and hence the condition in `request_roster()` always
False.

So the version is set in the roster request, and if there is no new
version on the server, we request no new roster even though we only
have ourself and previously open controls in our roster.

As a solution for this we delete the roster version from the config
in `RosterReceivedEvent` if the DB query comes back empty, which
triggers a new roster request.
2017-07-19 10:52:02 +02:00
Philipp Hörist e675df1803 Fix activity timers for groupchat
- Dont add timers when we autojoin minimized
- Remove timers when the chatcontrol gets minimized
- Send inactive chatstate when the chatcontrol gets minimized
- Add timers when the chatcontrol gets maximized
2017-07-16 23:58:54 +02:00
Philipp Hörist 4ba143fd68 Fix not working ManagePEPServicesWindow Dialog 2017-07-16 22:49:34 +02:00
Philipp Hörist 0877364214 Disable encryption if plugin is missing 2017-07-12 22:34:55 +02:00
Philipp Hörist ef38afcf90 Use namedtuples for results from the DB
This makes the code much easier to read, and much less error prone.
2017-07-12 22:34:55 +02:00
Philipp Hörist 84f48a400c Merge branch 'master' into 'master'
fixed lookup of description for keyed options

See merge request !105
2017-07-11 20:45:53 +02:00
SaltyBones e6840ab8b6 fixed lookup of description for keyed options 2017-07-11 20:35:47 +02:00
Philipp Hörist cc682d243f Change defaults on history restore options
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.
2017-07-10 21:03:45 +02:00
Philipp Hörist a818b60ba7 Fix unlimited muc_restore_timeout
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.
2017-07-10 20:13:10 +02:00
Philipp Hörist b625199c47 Allow for a no limit option on restore_timeout 2017-07-10 18:26:17 +02:00
Philipp Hörist aeb64a516c Use correct history date on muc join
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).
2017-07-10 16:39:27 +02:00
Philipp Hörist 5a8965791c Commit to DB before shutdown
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.
2017-07-10 16:25:26 +02:00
Philipp Hörist 0eca29d484 Fix memory leak in plugins window
- 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.
2017-07-10 01:15:30 +02:00
Yann Leboulanger 016acef245 Merge branch 'appdata' into 'master'
Add old id to appdata file

See merge request !104
2017-07-05 22:43:10 +02:00
André Apitzsch b80f21c1af Add old id to appdata file 2017-07-05 22:25:31 +02:00
Philipp Hörist ab85729fe5 Fix displaying links in textview
Regression from 79716f421f
2017-07-04 12:26:05 +02:00
Philipp Hörist 3d8be9ebe2 Fix emoticons module import on windows 2017-07-03 11:32:47 +02:00
Philipp Hörist 288b2a3bce Update README.md 2017-07-03 00:36:58 +02:00
Philipp Hörist d19f9e110d Merge branch 'popover' into 'master'
New Emoticons Menu

See merge request !102
2017-07-02 22:54:14 +02:00
Philipp Hörist 5dd4ac1c24 Update windows build to include emoticons 2017-07-02 21:30:21 +02:00
Philipp Hörist 635b05c1ca Make noto-emoticons the default theme 2017-07-02 21:30:21 +02:00
Philipp Hörist 89e4a006be Add font-emoticons theme 2017-07-02 21:29:57 +02:00
Philipp Hörist d387cf1d88 Add noto-emoticons theme 2017-07-02 21:29:57 +02:00
Philipp Hörist 79716f421f Rework emoticon menu 2017-07-02 21:27:44 +02:00
Philipp Hörist 0d0671374a Remove old emoticon themes 2017-07-02 19:28:00 +02:00
Yann Leboulanger fe75060098 Merge branch 'rename_src_gajim' into 'master'
Move src/ to gajim/

See merge request !103
2017-07-02 18:57:06 +02:00
André Apitzsch 125ce523e4 Rename src directory 2017-07-02 17:25:47 +02:00
André Apitzsch 68a57e7c91 Replace src by gajim 2017-07-02 17:25:46 +02:00
Philipp Hörist 6880fba3b4 Raise exception for missing icons
This is a regression from 9dc389cc32

previously we used load_icon() which raises an exception for missing icons

now we use lookup_icon() which does not, and iconinfo can be None now
2017-07-02 15:13:53 +02:00
Yann Leboulanger 6d9f82d827 show all previous corrected messages. Fixes #8669 2017-06-28 14:53:26 +02:00
Philipp Hörist bd3a0c8ac6 Only use GStreamer when Farstream is available
To use GStreamer we need to call Gst.Init().
We call Gst.Init() only when Farstream is available.
2017-06-28 00:43:44 +02:00
Philipp Hörist 923bbc87a2 Add LMC to common features 2017-06-28 00:06:43 +02:00
Philipp Hörist 55889d045f Add new extension point method 2017-06-27 20:51:55 +02:00
Philipp Hörist 1a2d32fca5 Better error message why pgp is not working 2017-06-26 18:09:15 +02:00
Philipp Hörist 7a6d7baebc Set password also on connection object on change 2017-06-25 23:14:35 +02:00
Philipp Hörist 6a49e2d869 Fix plugin installation from zip 2017-06-25 22:34:14 +02:00
Philipp Hörist b5d3578e39 Add tooltip for encryption button
Fixes #8663
2017-06-25 18:06:46 +02:00
Philipp Hörist 49a78ae8ed Support IPV6 and IPV4 domainparts
https://tools.ietf.org/html/rfc7622#section-3.2
2017-06-16 23:40:42 +02:00
Yann Leboulanger 4650615010 Merge branch 'jingleft' into 'master'
Update JingleFT support, and fix sending files

See merge request !89
2017-06-16 21:19:38 +02:00
Yann Leboulanger 7f4e930677 do not decode received data via IBB before writing them to a file 2017-06-16 21:15:24 +02:00