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

46 Commits

Author SHA1 Message Date
Michael Vetter
569e37f018 Update copyright to 2024 2024-01-22 16:03:48 +01:00
Steffen Jaeckel
4c26462827 Ensure instances of auto types are initialized
Follow-up of #1913

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-11-06 22:22:35 +01:00
John Hernandez
3a4cd7da48 Cleanup and mem leak fix
Improve usage of `gchar` and `char` by setting them correctly
Increase usage of `auto_gchar` and `auto_char`
Fix 2 mem leaks (rosterwin.c, avatar.c)
2023-07-12 17:43:33 +02:00
John Hernandez
e1d137f4e6 Change char->free to auto_char char for autocleanup
Replace `gchar` and `g_free` to `auto_gchar`
Correct certain  `char` functions/variables to `gchar`

Related to #1819.

Edited by @jubalh.
2023-07-11 13:26:37 +02:00
IsaacM88
ecdeb750f3 Add ability to disable avatar publishing
Add "/avatar disable" to comply with point "3.5 Publisher Disables
Avatar Publishing" in XEP-0084.

src/command/cmd_defs.c:2416
Add "disable" argument. Reword the "/avatar" command description
so it flows better.

src/command/cmd_ac.c:1101
Add "disable" to the "/avatar" autocomplete dictionary.

src/command/cmd_funcs.c:9277
Split "/avatar" commands into two groups with an if statement; those
with a parameter and those without. "cons_bad_cmd_usage()" is in both
groups, which is messy. "disable" has similar logic to "set", but it
includes a failure message.

src/xmpp/avatar.c:152
"avatar_publishing_disable()" uses the same logic to publish metadata
as in "avatar_set()".

src/xmpp/avatar.c:238
Add a message to inform users when they do not receive an avatar after
using "/avatar get" and "/avatar open". In case of a failure, the user
will be subscribed to future avatar updates as long as they continue
to use their current instance of profanity. Adding
"caps_remove_feature()" after "cons_show()" will unsubscribe the user
from avatar updates and prevent the user from downloading an avatar
unexpectedly hours later without issuing an "/avatar" command.

src/xmpp/stanza.c:2698
The new "disable" function follows the same logic as
"stanza_create_avatar_metadata_publish_iq()".
2023-05-02 14:45:54 -06:00
Michael Vetter
3adc399da0 Update copyright year 2023-01-10 10:37:25 +01: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
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
Michael Vetter
d510f3a430 Final touches for /avatar set 2022-05-27 10:46:36 +02:00
MarcoPolo-PasTonMolo
0cff111249 Add checks for whether gdk-pixbuf exists before using avatar set 2022-05-26 21:06:27 +03:00
MarcoPolo-PasTonMolo
6a44e18853 Add /avatar set command to publish avatar
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
2022-05-26 17:49:34 +03:00
Michael Vetter
1330ad4e1e Update copyright year 2022-05-09 15:43:33 +02:00
Steffen Jaeckel
9cf78e59d5 auto-format
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-02-01 15:01:28 +01:00
Michael Vetter
f21595597f Format code correctly 2021-10-05 10:01:27 +02:00
Michael Vetter
057c9ad776 Add config.h in files were it was missing
Related to https://github.com/profanity-im/profanity/issues/1512
2021-03-26 19:54:22 +01:00
Michael Vetter
e09f3fb615 avatar: make _avatar_request_item_result_handler safer 2021-03-25 16:35:43 +01:00
Michael Vetter
44343a5c37 avatar: make _avatar_metadata_handler safer 2021-03-25 16:34:20 +01:00
Michael Vetter
8c08e64f37 Update copyright 2021-01-08 16:36:30 +01:00
Michael Vetter
881b99c062 Remove not needed include 2020-12-16 14:46:01 +01:00
Philipp Klaus Krause
6a276e74e3 Since the string from strerror should never be modified, use const. 2020-10-14 09:52:26 +02:00
Michael Vetter
17b1b431f5 Replace stanza_get_child_by_name_and_ns with xmpp_stanza_get_child_by_name_and_ns
Replace our own stanza_get_child_by_name_and_ns() with the upstreamed
xmpp_stanza_get_child_by_name_and_ns() provided by the new
libstrophe/libmesode 0.10.0.
2020-09-30 19:41:08 +02:00
Michael Vetter
a2726b6a7d Apply coding style 2020-07-07 14:18:57 +02:00
Michael Vetter
a4cadf78fa Revert "Apply coding style"
This reverts commit 9b55f2dec0.

Sorting the includes creates some problems.
2020-07-07 13:53:30 +02:00
Michael Vetter
9b55f2dec0 Apply coding style
Regards https://github.com/profanity-im/profanity/issues/1396
2020-07-07 09:43:28 +02:00
Pierre Mazière
d92c576aa5 Get output and error streams from the command spawned by external_call()
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-06-03 13:09:29 +02:00
Michael Vetter
fc5fa62951 Create call_external() helper function 2020-05-20 10:54:58 +02:00
Michael Vetter
52e7e596aa xep-0084/avatar: add option to open avatar directly
Change:
`/avatar me@somewhere.org` -> `/avatar get me@somewhere.org`

New:
`/avatar cmd feh`
`/avatar open me@somewhere.org`

Implement https://github.com/profanity-im/profanity/issues/1281
2020-03-10 07:12:13 +01:00
Michael Vetter
ce48525e99 avatar: use unique id for stanza id
"retrieve1" should have been only for testing.
2020-02-07 21:12:59 +01:00
Michael Vetter
d4c27f2f78 xep-0084: use hash table for avatar lookup 2020-01-22 11:28:01 +01:00
Michael Vetter
be13e98fe7 Update my Copyright to 2020 2020-01-03 19:52:31 +01:00
Michael Vetter
5d7f2d1516 Add comments to avatar.c
And use better function names.
2019-12-23 20:56:38 +01:00
Michael Vetter
5170a2d542 Add string.h to avatars.c
Regards https://github.com/profanity-im/profanity/issues/1241
2019-12-19 20:04:19 +01:00
Michael Vetter
6c2fd1a8ca Include stdlib.h in avatar.c
We use malloc() and free().

Fix https://github.com/profanity-im/profanity/issues/1241
2019-12-19 18:21:48 +01:00
Michael Vetter
9ac72980d1 xep-0084: add test stub file 2019-12-18 15:44:59 +01:00
Michael Vetter
6978c39538 xep-0084: make internal functions static 2019-12-18 15:31:34 +01:00
Michael Vetter
da3ee9539d xep-0084: move id to avatar_metadata 2019-12-18 15:29:08 +01:00
Michael Vetter
fe41459d86 xep-0084: Add correct file extension 2019-12-18 15:20:07 +01:00
Michael Vetter
0ea1d3f85d xep-0084: Normalize at out of image filename 2019-12-18 14:36:18 +01:00
Michael Vetter
2b6b165ed2 xep-0084: Improve help 2019-12-18 14:35:47 +01:00
Michael Vetter
795ae00acf xep-0084:
So far we removed the avatar feature only after a succesful retrive in
avatar_request_item_by_id() before we are going to retrieve the actual
image.

We should remove it at every `/avatar barejid` call too so in case one
retrieval was unsucessful that we can call it again.

So far it seems like there is no other way to trigger getting the nodes
except announcing that we support the avatar feature.
2019-12-18 13:52:48 +01:00
Michael Vetter
64a86a1785 Fix header 2019-12-18 13:42:21 +01:00
Michael Vetter
3f58aba2bd xep-0084: save avatars in own directory 2019-12-18 13:29:28 +01:00
Michael Vetter
f692d6d0e0 xep-0084: Make it work multiple times 2019-12-18 13:14:17 +01:00
Michael Vetter
c2aa585615 xep-0084: Download avatars
Proof of concept.
Needs error checking, a nice interface, general cleanup..
2019-12-18 12:50:09 +01:00
Michael Vetter
e3538cf739 xep-0084: Look for specific user and print ID
Add a `/avatar` command.
2019-12-18 11:24:50 +01:00
Michael Vetter
771dfab123 Start implementing XEP-0084
So far we just subscribe and get the IDs.
2019-12-18 10:17:10 +01:00