1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00
Commit Graph

5171 Commits

Author SHA1 Message Date
Steffen Jaeckel
f406384c34 fix libstrophe timer-callback usage
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>
2023-01-26 11:49:29 +01:00
Steffen Jaeckel
99ffaf0a00 introduce auto_gcharv
This also fixes memory leaks in `_omemo_autocomplete()`.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-19 10:40:25 +01:00
Steffen Jaeckel
b535921484 introduce auto_jid and refcounting in Jid
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>
2023-01-19 10:40:25 +01:00
Steffen Jaeckel
1a85448bf2 improve const correctness
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:11:13 +01:00
Steffen Jaeckel
e886ba0c6f fix more memory leaks
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:11:13 +01:00
Steffen Jaeckel
698aefa005 fix memory leaks in OMEMO
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:11:13 +01:00
Steffen Jaeckel
302d0dd576 let account_new() take ownership of passed values
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Steffen Jaeckel
a0aa26b6fa add now option to /reconnect command
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Steffen Jaeckel
a45f05a45e slightly improve command_defs[]
* make the struct `const`
* use designated initializers
* remove `CMD_NOxyz` macros
* fix function-pointer correctness of `sub_func[]`

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Steffen Jaeckel
e9aaba938b minor changes
* fix typo
* less code duplication
* less `GString` usage
* more `auto_gchar` usage
* document connecting to servers supporting SASL ANONYMOUS
* ignore valgrind output

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Steffen Jaeckel
b1b6c6f62d add /strophe command to modify libstrophe-specific settings
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 17:04:41 +01:00
Michael Vetter
3adc399da0 Update copyright year 2023-01-10 10:37:25 +01:00
MarcoPolo-PasTonMolo
525ec11e46 Make /url save autocomplete filenames after a url
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
2022-12-27 14:39:31 +02:00
Michael Vetter
413b5f9bc9 Work around different clang-format versions
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.
2022-10-26 15:15:37 +02:00
Martin Dosch
a33d027f49 Improve MAM loading string.
Replaced three dots `...` by a proper ellipsis `…`.
Removed plenking (space between `messages` and ellipsis.
2022-10-22 16:09:39 +02:00
MarcoPolo-PasTonMolo
135a4cd9e6 Fix segfault when loading from MAM
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.
2022-10-22 12:56:15 +03:00
Michael Vetter
a04031cec9 Apply codigng style on new MAM code 2022-10-21 16:55:18 +02:00
Michael Vetter
5ebd7df7e8 Let users scroll up again
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.
2022-10-21 16:52:07 +02:00
Michael Vetter
688191f5e1 Fix merge mistake in database
When doing 3bdc14dbcf I forgot an `,`
before encryption
2022-10-21 16:39:44 +02:00
Paul Fertser
6a47266f0b Fix GSList handling in new MAM code
This patch was provided by @paulfertser and applied by @jubalh.
Thanks a lot Paul!
2022-10-21 16:28:30 +02:00
Michael Vetter
a74a3a4312 Fix merge mistake 2022-10-21 13:49:07 +02:00
Michael Vetter
3bdc14dbcf Merge MAM improvements from #1724
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.
2022-10-21 13:30:43 +02:00
Marouane L
f934c5b59f
Add vCard support
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)
2022-10-18 23:24:30 +01:00
Stefan Kropp
5401c1b634 Fix autocompletion for lastactivity
`/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
2022-10-17 17:12:29 +02:00
Michael Vetter
65aff65596 Improve /msg and /win autocompletion
Let /win and /msg both autocomplete roster nickname and actual barejid
2022-10-17 16:53:58 +02:00
Michael Vetter
aa9ba63f5f
Merge pull request #1760 from techmetx11/fix/1759-async
Replace `call_external`'s implementation with an async one
2022-10-12 12:45:07 +02:00
Marouane L
2d11a35ee1 Spawn external programs asynchronously
Drawback is that we can't check the exitcode anymore.
But we were unsure why/when we need this, see:
https://github.com/profanity-im/profanity/pull/1760/files#r980868708

Fixes https://github.com/profanity-im/profanity/issues/1759
2022-10-12 12:25:00 +02:00
Michael Vetter
a86e86cce0 Fix first start detection
Only display help message on first start.
This is a fixup for:
27a5c9d287
2022-10-11 16:39:55 +02:00
Michael Vetter
4b2bbe59ea Format Maxis commit properly 2022-09-29 11:11:01 +02:00
Maxi Wuttke
021927a549 Use G_GSIZE_FORMAT instead of "%lu" for portability
In the function stanza_create_avatar_metadata_publish_iq, use the format
string `"%"G_GSIZE_FORMAT` instead of "%lu", for an argument of type
gsize.
2022-09-29 10:46:32 +02:00
Michael Vetter
7ffe55e980
Merge pull request #1756 from sgn/python-3.11
plugin: python: fix build for Python 3.11
2022-09-25 22:34:25 +02:00
Đoàn Trần Công Danh
5a72fefe89 plugin: python: fix build for Python 3.11
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>
2022-09-24 12:49:12 +07:00
Viachaslau Khalikin
0cb46460b3
fix: print when no plugins installed
Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-20 04:30:11 +03:00
Viachaslau Khalikin
d75e5c1c28
add: autocompletion plugins arguments
support for "update" and "uninstall"

Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-20 04:00:44 +03:00
Viachaslau Khalikin
0ceb8c53c3
fix: filtering of the available global plugins
For command /plugins :
Don't print files that do not correspond to the plugins design

Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-20 01:46:51 +03:00
Viachaslau Khalikin
cc7231a43b
minor: using cons_bad_cmd_usage() instead of the manual handling
Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-19 18:08:54 +03:00
Viachaslau Khalikin
6cb6823aed
Fix typo which catched by codespell 2022-09-19 00:45:29 +03:00
Viachaslau Khalikin
45fa60e7e2
Print unloaded plugins which already installed
Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-19 00:29:24 +03:00
Viachaslau Khalikin
dd1a9a1e50
Fix handle cmd_plugins_uninstall without args
Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-19 00:12:49 +03:00
Steffen Jaeckel
25e56fb494 less strdup()+free()
Improvement of f8ff93234e

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-09-07 12:42:15 +02:00
Steffen Jaeckel
095d40d3bd tell the user to which file we're logging
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-09-07 10:04:00 +02:00
Steffen Jaeckel
099b443dc8 Tell user where the downloaded file is stored
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-09-07 10:04:00 +02:00
nandesu-utils
e1ed012f72 support for formatting in avatar executable
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.
2022-09-06 12:51:27 +02:00
nandesu-utils
056b19eb91 refactored call_external code
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.
2022-08-27 16:25:15 +03:00
MarcoPolo-PasTonMolo
d692aec32e Don't notify on MAM messages 2022-08-20 23:03:46 +03:00
MarcoPolo-PasTonMolo
a704838152 Handle late delivery 2022-08-20 22:48:02 +03:00
MarcoPolo-PasTonMolo
4b9ff6d4dc Apply corrections when getting messages from db 2022-08-12 12:13:47 +03:00
Steffen Jaeckel
65acffcf07 fixup 11f52ad547
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-08-08 17:15:58 +02:00
Steffen Jaeckel
11f52ad547 integrate XEP-0198 Stream-Management
* 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>
2022-08-08 13:39:58 +02:00
Michael Vetter
932e7826aa common: dont use GError twice
We need to use a new one or call `g_clear_error()`.

Fix segfault in https://github.com/profanity-im/profanity/issues/1738
2022-08-02 14:13:28 +02:00