1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00
Commit Graph

485 Commits

Author SHA1 Message Date
IsaacM88
23c6936398 Improve MUC title behaviour for roster, statusbar, and titlebar
## Abstract

Continuation of https://github.com/profanity-im/profanity/pull/1881

Give all MUC title commands a consistent command structure and appearance.

- `/roster room use name|jid` and `/roster room show|hide server` are now `/roster room title bookmark|jid|localpart|name`
- `/statusbar room room|jid` is now `/statusbar room title bookmark|jid|localpart|name`
- `/statusbar show|hide jid` and `/statusbar show|hide name` are now `/titlebar room title bookmark|jid|localpart|name`

Fix both bugs mentioned in https://github.com/profanity-im/profanity/pull/1881

### src/ui/mucwin.c:mucwin_generate_title

Called by each command to generate a properly formatted title. It checks for "name" first because "name" is the default preference for each command. The last if-statement sets the title to "localpart" for special cases when the title should be "localpart" instead of the user-defined preference.

## Testing

### Preparation

Remove preferences that will interfere with testing.

```
sed -i "/roster.rooms.title=/d" profrc
sed -i "/statusbar.room.title=/d" profrc
sed -i "/titlebar.muc.title=/d" profrc
sed -i "/roster.rooms.use.name=/d" profrc
sed -i "/roster.rooms.server=/d" profrc
sed -i "/statusbar.room=/d" profrc
sed -i "/titlebar.muc.title.jid=/d" profrc
sed -i "/titlebar.muc.title.name=/d" profrc
sed -i "/roster.rooms.by=/d" profrc
```

### Command Definitions

| Test | Window |
| :--- | :--- |
| `/help roster` | - /roster room title bookmark\|jid\|localpart\|name<br>- room title bookmark\|jid\|localpart\|name : Display the bookmark name, JID, JID localpart, or room name as the roster title for MUCs.<br>- *No /roster show\|hide server*<br>- *No /roster room use jid\|name* |
| `/help statusbar` | - /statusbar room title bookmark\|jid\|localpart\|name<br>- room title bookmark\|jid\|localpart\|name : Display the bookmark name, JID, JID localpart, or room name as the title for MUC tabs.<br>- *No /statusbar room jid\|room* |
| `/help titlebar` | - /titlebar room title bookmark\|jid\|localpart\|name<br>- room title bookmark\|jid\|localpart\|name : Display the bookmark name, JID, JID localpart, or room name as the MUC window title.<br>- *No /titlebar show\|hide jid\|name* |

### Autocomplete

| Test | Command line |
| :--- | :--- |
| `/roster room <TAB>` | Autocompletes `title` |
| `/roster room title <TAB>` | Autocompletes `bookmark\|jid\|localpart\|name` |
| `/statusbar room <TAB>` | Autocompletes `title` |
| `/statusbar room title <TAB>` | Autocompletes `bookmark\|jid\|localpart\|name` |
| `/titlebar room <TAB>` | Autocompletes `title` |
| `/titlebar room title <TAB>` | Autocompletes `bookmark\|jid\|localpart\|name` |
| `/roster room <TAB>` | Does not autocomplete `use`, `show`, or `hide` |
| `/roster room use <TAB>` | Does not autocomplete `name` |
| `/roster room show <TAB>` | Does not autocomplete `server` |
| `/roster room hide <TAB>` | Does not autocomplete `server` |
| `/statusbar room <TAB>` | Does not autocomplete `jid` or `room` |
| `/titlebar show <TAB>` | Does not autocomplete `jid` or `name` |
| `/titlebar hide <TAB>` | Does not autocomplete `jid` or `name` |

### Set Preferences

| Test | Window | profrc |
| :--- | :--- | :--- |
| `/roster room title bookmark` | Roster MUCs will display 'bookmark' as their title. | roster.rooms.title=bookmark |
| `/roster room title jid` | Roster MUCs will display 'jid' as their title. | roster.rooms.title=jid |
| `/roster room title localpart` | Roster MUCs will display 'localpart' as their title. | roster.rooms.title=localpart |
| `/roster room title name` | Roster MUCs will display 'name' as their title. | roster.rooms.title=name |
| `/roster room title invalid` | Invalid usage, see '/help roster' for details. | |
| `/statusbar room title bookmark` | Displaying 'bookmark' as the title for MUC tabs. | statusbar.room.title=bookmark |
| `/statusbar room title jid` | Displaying 'jid' as the title for MUC tabs. | statusbar.room.title=jid |
| `/statusbar room title localpart` | Displaying 'localpart' as the title for MUC tabs. | statusbar.room.title=localpart |
| `/statusbar room title name` | Displaying 'name' as the title for MUC tabs. | statusbar.room.title=name |
| `/statusbar room title invalid` | Invalid usage, see '/help statusbar' for details. |  |
| `/titlebar room title bookmark` | MUC windows will display 'bookmark' as the window title. | titlebar.muc.title=bookmark |
| `/titlebar room title jid` | MUC windows will display 'jid' as the window title. | titlebar.muc.title=jid |
| `/titlebar room title localpart` | MUC windows will display 'localpart' as the window title. | titlebar.muc.title=localpart |
| `/titlebar room title name` | MUC windows will display 'name' as the window title. | titlebar.muc.title=name |
| `/titlebar room title invalid` | Invalid usage, see '/help titlebar' for details. |  |
| `/roster room use jid` | Invalid usage, see '/help roster' for details. |  |
| `/roster room use name` | Invalid usage, see '/help roster' for details. |  |
| `/roster room show server` | Invalid usage, see '/help roster' for details. |  |
| `/roster room hide server` | Invalid usage, see '/help roster' for details. |  |
| `/statusbar room jid` | Invalid usage, see '/help statusbar' for details. |  |
| `/statusbar room room` | Invalid usage, see '/help statusbar' for details. |  |
| `/titlebar show jid` | Invalid usage, see '/help titlebar' for details. |  |
| `/titlebar hide jid` | Invalid usage, see '/help titlebar' for details. |  |
| `/titlebar show name` | Invalid usage, see '/help titlebar' for details. |  |
| `/titlebar hide name` | Invalid usage, see '/help titlebar' for details. |  |

### Display Set Preferences

| Test | Window |
| :--- | :--- |
| /prefs ui | - Roster rooms title (/roster) : name<br>- Room tab display (/statusbar) : name<br>- MUC window title (/titlebar) : name |

### Test MUC Window

#### Test: without *name* preference, without *room name* field

```
/join muc@dmn.im
/room config
/field1 ""
/form submit
/quit
```

| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im |
| `/room config` |  | muc<span/>@dmn.im conf | muc<span/>@dmn.im config |
| `/field2 edit` |  |  | muc<span/>@dmn.im config * |
| `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst |
| `/roster room by service` | muc |  |  |

#### Test: with *name* preference, without *room name* field

```
/roster room title name
/statusbar room title name
/titlebar room title name
/save
/quit
```

| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im |
| `/room config` |  | muc<span/>@dmn.im conf | muc<span/>@dmn.im config |
| `/field2 edit` |  |  | muc<span/>@dmn.im config * |
| `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst |
| `/roster room by service` | muc |  |  |

#### Test: without *name* preference, with *room name* field

```
sed -i "/roster.rooms.title=/d" profrc
sed -i "/statusbar.room.title=/d" profrc
sed -i "/titlebar.muc.title=/d" profrc
/join muc@dmn.im
/room config
/field1 "my_room"
/form submit
/quit
```

| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | my_room | my_room | my_room |
| `/room config` |  | my_room conf | my_room config |
| `/field2 edit` |  |  | my_room config * |
| `/msg tst` | tst | my_room/tst | my_room/tst |
| `/roster room by service` | my_room |  |  |

#### Test: with *name* preference, with *room name* field

```
/quit
/roster room title name
/statusbar room title name
/titlebar room title name
/save
/quit
```

| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | my_room | my_room | my_room |
| `/room config` |  | my_room conf | my_room config |
| `/field2 edit` |  |  | my_room config * |
| `/msg tst` | tst | my_room/tst | my_room/tst |
| `/roster room by service` | my_room |  |  |

#### Test: with *localpart* preference

```
/quit
/roster room title localpart
/statusbar room title localpart
/titlebar room title localpart
/save
/quit
```

| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | muc | muc | muc |
| `/room config` |  | muc conf | muc config |
| `/field2 edit` |  |  | muc config * |
| `/msg tst` | tst | muc/tst | muc/tst |
| `/roster room by service` | muc |  |  |

#### Test: with *bookmark* preference, without *bookmark name*

```
/quit
/roster room title bookmark
/statusbar room title bookmark
/titlebar room title bookmark
/save
/quit
/bookmark add muc@dmn.im
```

| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/bookmark join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im |
| `/room config` |  | muc<span/>@dmn.im conf | muc<span/>@dmn.im config |
| `/field2 edit` |  |  | muc<span/>@dmn.im config * |
| `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst |
| `/roster room by service` | muc |  |  |

#### Test: with *bookmark* preference, with *bookmark name*

```
/quit
/bookmark remove muc@dmn.im
/bookmark add muc@dmn.im name "my_bookmark"
```

| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/bookmark join muc@dmn.im` | my_bookmark | my_bookmark | my_bookmark |
| `/room config` |  | my_bookmark conf | my_bookmark config |
| `/field2 edit` |  |  | my_bookmark config * |
| `/msg tst` | tst | my_bookmark/tst | my_bookmark/tst |
| `/roster room by service` | my_bookmark |  |  |

#### Test: with *jid* preference

```
/quit
/roster room title jid
/statusbar room title jid
/titlebar room title jid
/save
/quit
```

| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im |
| `/room config` |  | muc<span/>@dmn.im conf | muc<span/>@dmn.im config |
| `/field2 edit` |  |  | muc<span/>@dmn.im config * |
| `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst |
| `/roster room by service` | muc |  |  |

### Test Contact Chat Window Title

#### Test: without contact nick

```
/roster add tst@dmn.im
```

| Test | Titlebar |
| :--- | :--- |
| `/msg tst@dmn.im` | tst<span/>@dmn.im |

#### Test: with contact nick

```
/roster add tst@dmn.im my_tst
```

| Test | Titlebar |
| :--- | :--- |
| `/msg my_tst` | my_tst <tst<span/>@ike.snikket.chat> |

### Test Preference Upgrade

#### Test /roster

| Test | profrc |
| :--- | :--- |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=name' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\roster.rooms.server=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc` | Original key removed.<br>roster.rooms.title=jid |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc`<br>`sed -i '/\[ui\]/a\roster.rooms.server=false' profrc` | Original keys removed.<br>roster.rooms.title=localpart |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc`<br>`sed -i '/\[ui\]/a\roster.rooms.server=true' profrc` | Original keys removed.<br>roster.rooms.title=jid |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc`<br>`sed -i '/\[ui\]/a\roster.rooms.server=' profrc` | Original keys removed.<br>roster.rooms.title=jid |
| `sed -i '/\[ui\]/a\statusbar.room=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\statusbar.room=room' profrc` | Original key removed.<br>statusbar.room.title=localpart |
| `sed -i '/\[ui\]/a\statusbar.room=jid' profrc` | Original key removed.<br>statusbar.room.title=jid |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.name=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=true' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.name=true' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=false' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.name=false' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=true' profrc`<br>`sed -i '/\[ui\]/a\titlebar.muc.title.name=false' profrc` | Original key removed.<br>titlebar.muc.title=jid |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=false' profrc`<br>`sed -i '/\[ui\]/a\titlebar.muc.title.name=true' profrc` | Original keys removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=true' profrc`<br>`sed -i '/\[ui\]/a\titlebar.muc.title.name=true' profrc` | Original keys removed. |

### Test Valgrind

No memory leaks detected relating to these changes.
2023-10-05 18:16:04 -06:00
Michael Vetter
f7cce4c5c1 Move /os into /privacy os
Related to https://github.com/profanity-im/profanity/issues/1836
2023-07-25 16:35:14 +02:00
John Hernandez
865a056315 Cleanup g_strfreev() to auto_gcharv
Include some additional minor cleanups
2023-07-13 17:05:07 +02:00
John Hernandez
029f1caa52 Cleanup jid_destroy to auto_jid
Remove unused variables
Apply minor cleanups
2023-07-13 17:05:07 +02:00
John Hernandez
8304ac86ff g_free() to auto_gfree, introduce auto_guchar
Fix 11 potential mem leaks in theme.c
2023-07-13 17:04:59 +02: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
00bea804e2 Improve documentation two functions
Namely `cmd_process_input()` and `files_get_data_path()`.

Edited by @jubalh.
2023-07-11 13:26:37 +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
John Hernandez
4a70f5f513 Cleanup char* to auto_gchar gchar* for prefs_get_string
Necessity explained in #1819
2023-07-03 16:06:27 +02:00
John Hernandez
1c102fec27 Add /privacy logging command
Add ability to completely turn logs off,
Needed since `/logging` and `/history` didn't stop history logging
in the DB, only in files.
Command might break something on usage,
hence it was primarily introduced for privacy geeks.
Privacy command discussion #1836
2023-07-03 16:06:24 +02:00
Michael Vetter
f67d548ebf
Merge pull request #1850 from H3rnand3zzz/feature/pgp-improved
Extend `/pgp` command to make key exchange procedure easier
2023-07-03 14:18:35 +02:00
John Hernandez
36784738fc Add optional pgp public key autoimport
Refactor `p_gpg_list_keys`
Add `/pgp autoimport` command,
it's not described in XEP-0027, but used in some clients,
such as PSI, Pidgin. It will autoimport keys received with
`/pgp sendpub`, in plain text as a message, or using features,
provided in other clients. It doesn't autoassign them, but shows
command to assign, letting user to decide.
Improve documentation for some preexisting functions
Add contact argument to `/pgp sendpub`
2023-07-02 14:25:55 +02:00
John Hernandez
349e4cb322 Refactor _cmd_set_boolean_preference function
Improve documentation
Update code formatting and indentation for better readability
Show state if no argument provided
Show if argument wasn't changed
Reduce amount of arguments
2023-07-02 14:25:55 +02:00
John Hernandez
a59623a007 Add /pgp sendpub command
Command allows to share your PGP pub key with ease,
it's not described in XEP-0027, but used in some clients,
such as PSI, Pidgin.
Fix typos
Minor improvements
2023-07-02 14:25:55 +02:00
Michael Vetter
6247c28e31
Merge pull request #1842 from H3rnand3zzz/feature/plugins-download
New Feature: Plugins Download
2023-06-06 18:35:18 +02:00
John Hernandez
95e06ad169 Add url support (downloading) to /plugins install
Additional changes include code refactoring.
2023-05-16 15:57:07 +02:00
John Hernandez
9a68aab011 /url save and /url open refactoring
Additional changes: jid.c minor refactoring
2023-05-11 09:44:55 +02:00
Michael Vetter
209a8f4bf5
Merge pull request #1847 from profanity-im/minor-improvements
Minor improvements
2023-05-11 08:43:37 +02:00
Steffen Jaeckel
8cd53acfd7 fix /reconnect now
This fixes #1846
Issue introduced by a0aa26b6fa

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-05-10 18:12:11 +02:00
Michael Vetter
60c197487d Add helper function for individual cmd_executable_*() functions
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.
2023-05-10 09:41:59 +02:00
Michael Vetter
46c90bc681 Make it possible to reset editor to default
All the other commands (avatar, vcard_photo, urlsave, urlopen) have the
ability to reset to default already.
2023-05-10 09:34:52 +02:00
Michael Vetter
8075b32ebc Align avatar behaviour with urlopen
`/executable avatar` now also uses cmdtemplate and parse %p.
It seems to me that the `/avatar` command was actually completely broken
on master.
2023-05-10 09:34:48 +02:00
Michael Vetter
daf3d193e2 Remove parsing of /avatar cmd
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.
2023-05-10 09:21:32 +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
f4d418a95f
Merge pull request #1838 from H3rnand3zzz/fix/omemo-trust-notification
Improve OMEMO messages
2023-04-19 17:53:27 +02:00
John Hernandez
a54e5413ca Fix /plugins update
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.
2023-04-19 03:29:23 +02:00
John Hernandez
26e97d4e80 Improve OMEMO messages 2023-04-19 00:34:17 +02:00
John Hernandez
5a1f2dedd3 Fix /log level crash
Fix crash caused by `/log level` command.

Minor refactoring of command function.
2023-04-18 18:16:57 +02:00
John Hernandez
07cc19ce10 Add sessions_alarm
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.
2023-04-18 14:28:20 +02:00
John Hernandez
5b8b9074a2 Add nickname support for /roster remove
Add support of name/nickname instead of only JID for `/roster remove` command.

Add tests for it as well.
2023-04-13 16:41:21 +02:00
Michael Vetter
e52ca2fbaa
Merge pull request #1815 from H3rnand3zzz/feature/the-client-switcher
Feature: Allow setting client identification name/version manually
2023-04-09 18:24:23 +02:00
John Hernandez
5d3c8ce7c1 Allow setting client identification name/version manually
Add changes allowing user to switch client name and version.

Useful for enhancing user privacy.

Minor cleanup.
2023-04-09 14:17:01 +02:00
Martin Dosch
e1ffc64a65 User proper ellipsis char
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 "…".
2023-04-09 12:19:18 +02:00
Steffen Jaeckel
0cf79848e9 add /statusbar tabmode actlist
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>
2023-04-08 18:38:36 +02:00
Michael Vetter
e59c401c84 Adapt to g_string_free glib 2.75.3 change
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.
2023-03-21 10:53:10 +01:00
IsaacM88
d043d53948 Fix duplicate download IDs.
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.
2023-03-09 15:02:26 -07: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
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
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
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
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
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
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
Netboy3
4ea98c71ee Fix /autoaway command logic
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.
2022-07-28 11:48:38 -04:00