In console autocomplete from roster.
In muc autocomplete from occupants lits.
In 1:1 regular chat autocomplete from active resources of currently
selected user (new).
Also give a hint (/help resource) how to set the resource should a user choose that way.
Fix https://github.com/profanity-im/profanity/issues/1337
1f8b1eb740 made it possible to have utf8 chars as correction chars. So since then prefs_get_correction_char() doesn't return a regular char but a char*.
Seems like there was an oversight that we need to use %s then.
For some time users could choose to have the old way "unanimous" where
all the MUC history is just grey (or whatever was set). Now it is always
just displayed like regular new incoming MUC text.
Profanity request the OMEMO Device List for all members, also if the MUC is
anonymouse. If the user is Admin / Owner, the device list will be requtest.
Issue #1315
glib functions can allocate a GError object that must be freed with
g_error_free(). Otherwise a memory leak happens.
There are similar unfixed places in omemo, check:
grep "&error" src/omemo/omemo.c
Fixes#1304.
MUCPMs and regular chat messages get printed with the same code.
But we don't save MUC PMs in the sqldb, because another jid could use
the same nick the next time.
And if we would take the log out we would need a different routine,
checking for resourcepart too.
Fix https://github.com/profanity-im/profanity/issues/1312
Only when we start the conversation.
Not yet when we get messaged and a new window is opened.
Need to have sorting of messages in the window buffer then, I guess.
Also MAM IQ should only be send one time in such a case.
If MAM is enabled history from sql backend will not be shown.
`mam` in profrc enables experimental MAM.
Can change soon again. Don't rely on stuff in this stage ;)
Later we will have several options.
Getting everything since last timestamp (if none everything at all).
Getting everything since today + configure time (1 week).
Should also have a reload all command like conversations once you
cleared the history.
All MAM messages should be written into sql db.
And then probably displayed from there so that regular history works
too.
MAM messages don't have a type nor a from.
If we detect a message without type let's log it and exit without
continuing to try to parse it.
Otherwise we go into _handle_chat() and crash on the no from.
The function creates a form to find such strings as software, os, etc.
It remembers the strings allocated by form_create() and use them below
in caps_create(). The issue is that the form is destroyed before and as
result the strings are freed too.
As solution, allocate own copy of strings.
Otherwise we print the freshly received message to the window twice.
Once when receiving (and immediately printing), then logging it, and
then again when we print the last 10 log entries.
Fix https://github.com/profanity-im/profanity/issues/1305
Use g_date_time_format() instead of g_date_time_format_iso8601() to only
rely on glib 2.56.0 which is the latest version in Debian Buster
(current stable).
We also only use basic sqlite functions so 3.27.0 should be fine there
(also the one in Debian buster).
Thanks to @DebXWoody.
We now dont get the log files from the text files via chat_log_get_previous() anymore.
We use the sql backend via log_database_get_previous_chat().
So far it just has the same behaviour like chat_log_get_previous(),
except that in _chatwin_history() we don't pass the sender to
win_print_history() which should be fixed in a commit soon.
And log_database_get_previous_chat() can later easily be expanded to fix
https://github.com/profanity-im/profanity/issues/205.
Maybe if we only use `/connect` we dont have ProfAccount. In that case
we won't log anything. Only if a account is used we log.
If this is the case or the init of the db didn't work we still want
profanity to run but wont log anything to the db.
Timestamps are only set if a message is delayed.
If none is set let's set it upon recaival so we don't have to set it
when it gets displayed.
This means we will also have it for logs etc in the ProfMessage.