python-gnupg uses latin1 as default encoding because GPG itself uses
latin1 as default.
We should not override this default with getpreferredencoding, because
getpreferredencoding maybe returns something else than what GPG is configured
on that system.
Example: On Windows
GPG is run in default mode with 'latin1'
getpreferredencoding returns 'cp1252'
The approach would be now to default to latin1 as it is GPGs default.
And if the User sets a different ecoding for GPG he has to set it in
Gajim aswell.
- Pass EventObj instead of variables
- decrease indent level
- check all conditions inside log_message() not before calling
- fixed bug where gc private messages where not logged with the correct jid
Both methods get_conversation_for_date and search_log in the logger
module are related to the loading of conversations and both return a
list of messages from the log. Therefore, it makes sense that both of
them have the same return type.
Remove the named tuple type specific to search_log and convert the
method to return tuples of type Message instead. As a side effect of
this change, search_log now also returns values from the additional_data
column in the log database.
The logger method get_conversation_for_date has previously been
converted to return a list of named tuples. Now pass these tuples on to
the method that actually inserts the conversation's messages into the
textbuffer. Also rename two related methods in the history window:
- _add_lines_for_date => _load_conversation
- _add_new_line => _add_message
The get_conversation_for_date method in the logger module returns a
list of bare tuples. Knowledge of how to pack and unpack the many
individual components of the tuples is split between the caller and
the callee, making the method hard to maintain and ugly to use.
Therefore, convert the method to return named tuple instead.
The get_search_results_for_query method in the logger module returns a
list of bare tuples. Knowledge of how to pack and unpack the many
indidual components of the tuples is scattered across both the callers
and the callee, making the method hard to maintain and ugly to use.
Therefore, convert the method to return named tuples instead.
Currently, there are no enumerations using the enum module which reuse
values/need aliases. Add the @unique decorator to all enum classes as a
safety net for future modifications.
Currently works on released gajim, but not on nightly.
This explicit check for resource in the to-jid just returns if there is no
resource. It doesn't even cancel the file transfer or anything, it just
stops... which looks to the user like a file transfer hang. Removing
the check makes Gajim work as expected.
Closes#8581
Currently, the additional_data column is not correctly loaded from the
log database in the logger module's methods get_last_conversation_lines
and get_conversation_for_date. While the JSON data in the column is
parsed, the parsed value is not saved, because the code assumes that
changes to a loop variable are reflected in the list that is iterated
over. Instead, the unparsed JSON string is returned. Fix this by building
a separate list with the JSON string replaced by the parsed JSON object.
When the roster window active it can be filtered by starting to type.
If the window behavior "single window for everything" is selected,
trying to abort the filtering by pressing the ESC key also closes a chat
window. Fix this behavior by stopping event propagation in case the ESC
key is pressed while roster filtering is active.
Fixes issue #8548.
Notifications for a JID are removed when we see activity
in the form of a sent carbon copie from one of our other devices.
If we receive such carbon copies we can conclude that the message
we received earlier was answered from one of our other devices.
the 'query-tooltip' event does essentially the same
as the 'motion-notify-event' but supplys us with coordinates,
which lets us get rid of deprecated get_client_pointer()
The 'query-tooltip' event does essentially the same as the
'motion-notify-event' but supplys us with coordinates,
which lets us get rid of deprecated get_client_pointer()
Add a connect_tooltip() method that allows other classes
that use HtmlTextView to provide their own tooltip method
Commit d75ebd95e5 modified the return value of logger.py's method
get_search_results_for_query by appending another component to the
tuple. Because of this unpacking the tuple in the command system's grep
command failed.
ChatControlBase was split from ChatControl into its own module in commit
80221afc2c. With this split the import of the CommandContainer modules
was removed as well, likely because their members are not referenced
anywhere. However, importing these modules even when they are not used
directly is crucial because the contained CommandContainers are only
registered with the command system when their definitions are evaluated.
Import the modules with CommandContainers in chat_control_base.py to fix
the command system. Also add a comment stating more clearly why the
imports need to be kept around.
The definition of various constants was refactored to use enumerations
in commit 2fbadc91e9. One reference in the command system was not
changed to use the new enum, however.
Do not reload the conversation in the history window when the user
selects another search result from the same day. Just clearing the
previous highlighting is enough. This prevents flickering and provides
a much more pleasant user experience.
Search results in the history window to are scrolled to and highlighted
once the user clicks on one of them. Messages are searched by text in
the log database, but then looked up in the history text buffer via a
visible or invisible timestamp obtained from the database record.
Timestamps in the history text buffer, depending on user configuration,
may only have a coarse granularity. Philipp Hörist discovered that this
may lead to the highlighting of the wrong line in the history text view
and proposed an alternative solution that is implemented in this patch.
Timestamps are abolished as a means of searching messages. Instead, add
a mark with the unique message id (log line id) at the start of every
message in the history text buffer when the conversation is loaded.
After fetching the search results from the database this id can be used
to unambiguously find the corresponding message in the history text
buffer.
The method get_search_results_for_query provides a means to search via a
passed in SQL query. This feature has been unused and dead since its initial
commit back in 2005 (commit e542fff69f), so just remove it.
The message to be highlighted is searched via an already formatted
timestamp, and the match contains the whole timestamp with any
preceding characters (like "["). Therefore, calling backward_char on
the start iterator of the match just goes back to the previous line
and is not needed.
A single message may span multiple paragraphs. Highlight all paragraphs
of a search result because a keyword could be in any of them.
Every message already has the 'eol' tag on its newline character.
Highlight from the start of a search match up to the next 'eol' tag.
context.get_background_color() first calls the CellRenderer to render
the cell before giving back the color.
When we call this inside a CellRenderer, this is an endless loop