about summary refs log tree commit diff stats
path: root/src/command/cmd_funcs.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1847 from profanity-im/minor-improvementsMichael Vetter2023-05-111-1/+2
|\ | | | | Minor improvements
| * fix `/reconnect now`Steffen Jaeckel2023-05-101-1/+2
| | | | | | | | | | | | | | This fixes #1846 Issue introduced by a0aa26b6fa65ba625f4a6d3495a345c7120ff16d Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* | Add helper function for individual cmd_executable_*() functionsMichael Vetter2023-05-101-46/+7
| | | | | | | | | | | | Each of the cmd_executable_editor(), cmd_executable_urlopen() etc calls this helper function since they were all doing the same just for different configurations.
* | Make it possible to reset editor to defaultMichael Vetter2023-05-101-0/+3
| | | | | | | | | | All the other commands (avatar, vcard_photo, urlsave, urlopen) have the ability to reset to default already.
* | Align avatar behaviour with urlopenMichael Vetter2023-05-101-15/+18
| | | | | | | | | | | | `/executable avatar` now also uses cmdtemplate and parse %p. It seems to me that the `/avatar` command was actually completely broken on master.
* | Remove parsing of /avatar cmdMichael Vetter2023-05-101-3/+0
|/ | | | | | This is done in `/executable avatar set` since d7848e38b. The command help also didn't mention this anymore. Seems like it was forgotten to remove the actual parsing of this.
* Add ability to disable avatar publishingIsaacM882023-05-021-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()".
* Merge pull request #1838 from H3rnand3zzz/fix/omemo-trust-notificationMichael Vetter2023-04-191-3/+3
|\ | | | | Improve OMEMO messages
| * Improve OMEMO messagesJohn Hernandez2023-04-191-3/+3
| |
* | Fix `/plugins update`John Hernandez2023-04-191-31/+22
|/ | | | | | | | | | | Before it tried to unload the plugin first and check the output. But if broken plugin was loaded, then it couldn't unload it, so before it require uninstall and install after it, making update useless for plugin development purposes. Unload is part of the uninstall so no unload is needed inside of the cmd function. Refactoring of cmd_plugins_update.
* Fix `/log level` crashJohn Hernandez2023-04-181-18/+10
| | | | | | Fix crash caused by `/log level` command. Minor refactoring of command function.
* Add sessions_alarmJohn Hernandez2023-04-181-0/+27
| | | | | | | | | Introduce new feature: sessions_alarm. Added new account setting: max_connections. On exceeding this number, user will get an alert. If number is less than 1, no alert will happen. Tests altered to fit new feature.
* Add nickname support for /roster removeJohn Hernandez2023-04-131-5/+8
| | | | | | Add support of name/nickname instead of only JID for `/roster remove` command. Add tests for it as well.
* Merge pull request #1815 from H3rnand3zzz/feature/the-client-switcherMichael Vetter2023-04-091-12/+14
|\ | | | | Feature: Allow setting client identification name/version manually
| * Allow setting client identification name/version manuallyJohn Hernandez2023-04-091-12/+14
| | | | | | | | | | | | | | | | Add changes allowing user to switch client name and version. Useful for enhancing user privacy. Minor cleanup.
* | User proper ellipsis charMartin Dosch2023-04-091-15/+15
| | | | | | | | | | | | | | As stated in https://github.com/profanity-im/profanity/pull/1820#issuecomment-1498083383 profanity uses "..." (three dots) in a lot of places instead the proper ellipsis char "…".
* | add `/statusbar tabmode actlist`Steffen Jaeckel2023-04-081-0/+15
|/ | | | | | | | | | The existing way how active tabs are displayed didn't allow showing more than 10 tabs. This patch adds a mode where the statusbar shows a comma-separated list of tabs which were active since the last time viewed. This view is inspired by how `irssi` shows the active tabs, therefore it is also called `actlist`. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* Adapt to g_string_free glib 2.75.3 changeMichael Vetter2023-03-211-13/+2
| | | | | | | | | | | | glib 2.75.3 changes warning behaviour of `g_string_free()`. See: * https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3219 * https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3226 Use this opportunity to replace the use of GString with `g_strdup_printf()` where possible. Otherwise correctly take the return value of `g_string_free()` which is nicer anyways.
* Fix duplicate download IDs.IsaacM882023-03-091-5/+13
| | | | | | | | | | 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.
* fix more memory leaksSteffen Jaeckel2023-01-181-5/+7
| | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* add `now` option to `/reconnect` commandSteffen Jaeckel2023-01-181-6/+8
| | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* slightly improve `command_defs[]`Steffen Jaeckel2023-01-181-5/+4
| | | | | | | | | * 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>
* minor changesSteffen Jaeckel2023-01-181-20/+12
| | | | | | | | | | | * 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>
* add `/strophe` command to modify libstrophe-specific settingsSteffen Jaeckel2023-01-181-0/+35
| | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* Update copyright yearMichael Vetter2023-01-101-1/+1
|
* Add vCard supportMarouane L2022-10-181-0/+990
| | | | | | | | | | | | 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)
* Spawn external programs asynchronouslyMarouane L2022-10-121-1/+1
| | | | | | | | 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
* fix: print when no plugins installedViachaslau Khalikin2022-09-201-12/+15
| | | | Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
* fix: filtering of the available global pluginsViachaslau Khalikin2022-09-201-2/+4
| | | | | | | For command /plugins : Don't print files that do not correspond to the plugins design Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
* minor: using cons_bad_cmd_usage() instead of the manual handlingViachaslau Khalikin2022-09-191-3/+3
| | | | Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
* Print unloaded plugins which already installedViachaslau Khalikin2022-09-191-2/+13
| | | | Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
* Fix handle cmd_plugins_uninstall without argsViachaslau Khalikin2022-09-191-1/+2
| | | | Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
* Fix /autoaway command logicNetboy32022-07-281-4/+2
| | | | | | | | | | | | 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.
* Split ox functions from gpg.c to ox.cMichael Vetter2022-06-291-0/+1
|
* Let user change log level while runningMichael Vetter2022-06-221-2/+12
| | | | | | | | | | | `/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
* Display mood preferencesMichael Vetter2022-06-221-1/+1
|
* Make mood display optionalMichael Vetter2022-06-221-1/+9
|
* Don't forget encryption status for OX and PGP.MarcoPolo-PasTonMolo2022-06-171-0/+4
| | | | | | | | Use a pgp.enabled and ox.enabled array the same way that omemo.enabled is used. Fixes https://github.com/profanity-im/profanity/issues/1694 Fixes https://github.com/profanity-im/profanity/issues/733
* Use our omemo sid/fingerprint in qr codeMichael Vetter2022-05-311-2/+4
| | | | | | | Current clients sid/fingerprint will be shown in following format: `xmpp:<user@server>?omemo-sid-<numerical-sid>=<omemo-fingerprint-hex-string>` Fix https://github.com/profanity-im/profanity/issues/1320
* Reverse QR code colors and add paddingswirl2022-05-301-1/+0
| | | | | | | 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>
* implement working OMEMO QR codeswirl2022-05-301-1/+13
| | | | | | | | 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>
* Add basic qrcode functionsMichael Vetter2022-05-301-0/+12
|
* Final touches for `/avatar set`Michael Vetter2022-05-271-1/+1
|
* Add checks for whether gdk-pixbuf exists before using avatar setMarcoPolo-PasTonMolo2022-05-261-0/+4
|
* Add `/avatar set` command to publish avatarMarcoPolo-PasTonMolo2022-05-261-1/+5
| | | | | | | | 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
* Update copyright yearMichael Vetter2022-05-091-1/+1
|
* ox: show ox preferencesMichael Vetter2022-05-051-0/+4
|
* ox: Add /ox log commandMichael Vetter2022-05-051-0/+25
|
* ox: print message when `/ox end` is run but not startedMichael Vetter2022-05-041-4/+8
|
* ox: implement `/ox end`Michael Vetter2022-05-031-0/+12
| | | | We also need to be able to stop an ox conversation :-)