* Make editor executable into a string to be able to support
(multiple) flags.
* Change /help executable to suit this new feature
Signed-off-by: Daniel Santos <dacs.git@brilhante.top>
Rewrite `win_get_title()` to using switch without a default case. So the compiler warns us
(`enumeration value ‘WIN_XXX’ not handled in switch`)
in case we add a new window type (WIN_CHAT, WIN_PRIV etc) and forget to
adapt this function.
Add assert() in the end to make compiler happy when he realizes there
the function might have no return value (`control reaches end of
non-void function`). This should ever be reached.
Replace the default value of `win_to_string()`, `win_get_tab_identifier()` as
well, and replace it with an assert.
See discussion started at https://github.com/profanity-im/profanity/pull/1799#discussion_r1142444684
Fixes https://github.com/profanity-im/profanity/issues/1794
Explanation
The problem is the download's identifier. Downloads are given an ID so they can be referenced later when their progress changes. Currently, the download's ID is the download's URL. When you download the same file twice, you have two downloads with the same ID. Download progress updates are shown on the first of both downloads with the same ID.
Solution
Change the download's ID from its URL to a random number. A random ID is generated when get_random_string() is called from cmd_funcs.c. Several other functions are updated to cope with the new ID format.
After adding MAM quote and url autocompletion wouldn't pick up messages
from MAM or history(from DB) or would have them in the wrong order. This
commit fixes that.
Fixes https://github.com/profanity-im/profanity/issues/1770
The timer will be auto-removed if the callback returns `0`. The way it was
done before breaks some internals of libstrophe.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This also fixes a memory leak from within `_handle_groupchat()` in [0].
[0] src/xmpp/message.c
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Previously after the url if you pressed tab, even if you typed out a
filepath, profanity would erase that and cycle through url autocomplete
results.
This patch solves that and autocompletes filepaths after the url.
Fixes https://github.com/profanity-im/profanity/issues/1783
Locally I have clang-format 15.0.2.
Our CI runs ubuntu-20.04 so it has 10.0.
Seems like a default value changed but I can't find it.
When I still had clang-format 14.x everything was fine and checking:
https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
I only see irrelevant things.
Someone on the llvm IRC channel sais "there is no guarantee" and "maybe
a regression or intended change".
But seems like noone knows which setting could be the one we need.
Since I don't have a better solution for now I will just edit this by
hand to apply to the clang-format version we have on the CI.
Will look into updating this one.
But in any case it would be best if the configuration file could have
this setting so formatting works the same for all contributors.
When loading messages from MAM profanity would segfault. Reason was that
we were freeing the timestamp of messages when displaying them and we
needed it for loading MAM.
We removed this so that we don't get "[SCROLLED]" in the titlebar when
there is actually not more text available.
But now with MAM we can enable this again so that the user can scroll up
and load more text out of the database.
Maybe this also could use a check.
This reverts commit c84b1b5e5d.
I think this PR already solves and improves the MAM situation a lot.
What's @MarcoPolo-PasTonMolo still wanted to do in this branch is:
* MAM for mucs
* Check if url and quotes autocompletion works fine
* Check if the api still works fine
* Resolve conflicts
Conflicts are solved with this commit.
MAM for mucs can be another feature PR.
The rest we can check while being on master. And more people can help
testing.
Only nicknames, photos, birthdays, addresses, telephone numbers, emails,
JIDs, titles, roles, notes, and URLs are supported
Due to the synopsis array not having enough space, `/vcard photo
open-self` and `/vcard photo save-self` are not documented properly in
the synopsis section of the `/vcard` command, but they are documented in
the arguments section
Fixed memory leak in vcard autocomplete (thanks to debXwoody)
`/lastactivity` used autocompletion for /status instead.
There was no get/set autocompletion thus user had to write `/lastactivity
get` to get the proper results.
Original fix by Stefan at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021028
Proper commit message and adapted patch by jubalh.
Co-authored-by: jubalh@iodoru.org
From Python 3.11, PyFrameObject has been changed into opaque struct.
We need to access those fields via API.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
For command /plugins :
Don't print files that do not correspond to the plugins design
Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
in before it just used the input command line as it was but this fixes
this by adding formatting using `format_call_external_argv` which is
already used in `url open` executable.
unluckily here the code neglected the fact that glib will set an error
to a location that was pointed by the error pointer if it is not null.
but it was of an undefined value hence profanity crashed. now it is null
as it must be.
also spawn error is returned when glib could not spawn the task for
some reason like the executable file does not exist but if the exit
status was non-zero it neglected the exit error and tried to output a
spawn error instead. now we check whether the process that we
instantiated has exited successfully
also now code uses `g_spawn_check_wait_status` which
`g_spawn_check_exit_status` has been aliased to.
* save SM state and send-queue entries on disconnect
* restore SM state and send-queue entries on reconnect
fixes#698
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Two issues were fixed in the parser logic:
* A call to cons_bad_cmd_usage() was placed at the end of the "time"
parser section that blocked reachability to both "message" and
"check" parser sections. This caused "/autoaway message ..." and
"/autoaway check ..." to always fail with "Invalid usage". This
issue was introduced in commit 3c1e4ba.
* "/autoaway message xa" with no message argument returns message
set to (null). This should be fixed the same way as
"/autoaway message away" was fixed in commit 3c1e4ba.
Did this by waiting for a batch of MAM messages to arrive before
prepending them to the buffer. Also limited the number of messages
to fetch to 10 so that the user gets more frequent updates.
Fetch from mam without displaying when all mam messages get received
display new messages from db.
Unstable, initial mam doesn't get displayed unless we start scrolling.
If we are in a window with a lot of text and press PAGE UP we scroll up
and write [scrolled] in the titlebar.
So far we also wrote [scrolled] in there even when actually nothing
happened. Like when opening a new window (/msg someone) and there is no
text inside.
`/log level INFO|DEBUG|WARN|ERROR` is now available.
Looks like this solves a TODO (see removed comment in source) from 2013
:-)
Works only with default log file. Not with user provided log file during
start up via the -f parameter.
Fix https://github.com/profanity-im/profanity/issues/1627
"" used to become " now it just becomes an empty argument.
Also if quotes appeared after a token started then if the number of
quotes in the token is n the resulting one would be a token with the
n last characters cut off, now it's fixed.
Fixes https://github.com/profanity-im/profanity/issues/497
Messages would get duplicated when you chat with yourself, worse if you
had omemo enabled the duplicated message would say something along the
lines of "Your client doesn't support OMEMO". The cause was carbons
when the message was sent from another client, whilst it was a sent
and received message when profanity was the one to send it. This commit
ignores the carbon message in the 1st case and ignores the received one
in the 2nd.
Fixes https://github.com/profanity-im/profanity/issues/1595
All QR scanners should be able to recognize this, as it is now the
correct color with some padding to prevent blending.
Signed-off-by: swirl <swurl@swurl.xyz>
TODO: We need to find a way to switch the colors of the QR code, so that
more QR readers can detect it, without "blending" the edges of the QR
code with the surrounding terminal window.
Signed-off-by: swirl <swurl@swurl.xyz>
Muc configuration in profanity used to not update until next login, ie:
make muc non_anonymous and members_only but be unable to start omemo
until next login. Now a disco info request is sent after forrm submit
and chatroom details are changed accordingly.
Fixes https://github.com/profanity-im/profanity/issues/1347
Profanity would ignore the silent nick change in some places. The roster
and history would show the correct nick, new messages from the current
user and the "Autojoined <jid> as <nick>" message would show the wrong
one. This commit fixes that problem.
Fixes https://github.com/profanity-im/profanity/issues/757
`/ox discover` segfaults on some misconfigured? nodes because there are
newlines before and after some pubkey-metadata stanzas so the newlines
get treated as seperate stanzas. This commit just skips each stanza in
public-keys-list that doesn't have a fingerprint.
Fixes https://github.com/profanity-im/profanity/issues/1713
Use `/avatar set <path>` where <path> is an image file to upload a new
avatar for the current user. When the avatar is too big it gets scaled
down. Scaling code copied from dino.
Fixes https://github.com/profanity-im/profanity/issues/1687
We only want to have the decrypted message or the alternative body in
message->plain.
Also let's print error messages if it makes sense and log other issues.
Partly addresses the commit in the comit mesage of:
2dc0cc489c