Like mentioned on the review at
https://github.com/profanity-im/profanity/pull/1605 I don't ge why
@DebXWoody changed the code like he did.
I changed it to something that made more sense to me now.
Instead of looking for headline in two places and checking for pubsub in
a headline place (only).
I didn't check this deeply. And still have a feeling that this is not
the best way to go. But I didn't read the XEP yet.
Added a TODO to the code regarding this too.
A quick skimming through https://xmpp.org/extensions/xep-0107.html
doesn't show me anything regarding headline. So I really don't see why
this needs to go here.
Hopefully @DebXWoody checks this in the future. But since he didn't
react on the PR I decided to make some adjustments myself so we can
merge it.
* Remarks in the Merge Request (ac_reset, help)
* Defines in iq.c
* Mood help and null check
* Added additional information about tab key in CMD_DESC.
* Added additional null check
We came into the carbons checking code when we received `<private
xmlns="urn:xmpp:carbons:2"/>`. Which actually marks a message to _not_
be a carbon.
In this code we also make sure that carbons only come from us.
If not we don't call the message handler code.
So we should actually only check for `<sent xmlns='urn:xmpp:carbons:2'>`
and `<received xmlns='urn:xmpp:carbons:2'>`.
Thanks pukkamustard and Holger.
Fixes https://github.com/profanity-im/profanity/issues/1614
gcc-12 detects redundant check against array of arrays as:
src/plugins/python_api.c: In function ‘python_api_register_command’:
src/plugins/python_api.c:199:31: error: the comparison will always evaluate as ‘true’ for the address of ‘c_arguments’ will never be NULL [-Werror=address]
199 | while (c_arguments[i] != NULL && c_arguments[i][0] != NULL) {
| ^~
src/plugins/python_api.c:161:15: note: ‘c_arguments’ declared here
161 | char* c_arguments[args_len == 0 ? 0 : args_len + 1][2];
| ^~~~~~~~~~~
gcc-12 detects redundant check against array of arrays as:
src/plugins/callbacks.c: In function ‘_free_command_help’:
src/plugins/callbacks.c:85:26: error: the comparison will always evaluate as ‘true’ for the address of ‘args’ will never be NULL [-Werror=address]
85 | while (help->args[i] != NULL && help->args[i][0] != NULL) {
| ^~
In file included from ./src/ui/ui.h:44,
from ./src/command/cmd_defs.h:42,
from src/plugins/callbacks.c:41:
./src/command/cmd_funcs.h:48:12: note: ‘args’ declared here
48 | gchar* args[128][2];
| ^~~~
* Fix `src/command/cmd_funcs.c:9463:9: error: ignoring return value of
‘write’ declared with attribute ‘warn_unused_result’
[-Werror=unused-result]`
* Free memory earlier and on less places
* Check for succesful open() and write()
After generation of an identity we observe that `omemo_ctx.device_list`
has an entry for sender's jid. But on application restart it is absent
thus messages are not encrypted for the rest set of sender devices.
This commit fixes this by applying code for acquiring the aforementioned device list after the connection.
We decided that it was better to remove autocomplete for this command,
since adding it only introduced problems and the command can still
function perfectly without autocomplete.
This and the following commits should make a couple of more configs
allow utf8 chars so people can use their weird icons :-)
We did the same for the otr/omemo/pgp indicators at:
1f8b1eb7405cf6ee1bc6
Fixes https://github.com/profanity-im/profanity/issues/1423
Oldest stanza is fetched like before but now the timestamp is generated by creating date_time_from_iso8601 and then to_local, instead of trusting that the timestamp is in utc.
The procedure previously was stamp = time_val_from_iso8601() then date_time = date_time_from_utc(stamp) then local_date_time = to_local(date_time)
`/plugins install` installs a plugin to
`.local/share/profanity/plugins`.
And also loads it.
When a plugin is loaded it will automatically be added to the `profrc`
file like this:
```
[plugins]
load=my.py;
```
On the next start Profanity will try to load this plugin again unless
`/plugin unload my.py` is called.
If `~/dir` exists profanity exits for me.
Whole code for updating plugins from a dir isn't even implemented. Even
though some messgages suggest otherwise.
Remove this and only allow updating of one file.
Two options to install plugins.
Mention the whole path:
`/plugins install ~/src/profanity-plugins/my.py`
Mention only the plugin name:
`/plugins install my.py`
The latter will look in `/usr/local/share/profanity/plugins/` for the
file and copy it over to `~/.local/share/profanity/plugins`.
At first I was thinking about loading the plugins from the global
location. But users most likely don't want to have all plugins activated
that an admin installs on a system.
Regards https://github.com/profanity-im/profanity/issues/945
I feel like this mostly is confusing people.
Also don't see much value for it.
To me it looks like a regular workflow is like:
```
/plugin install ~/src/profanity-plugins/my.py
```
The whole thing with sourcepath, install (which also loads without
having that described anywhere), load etc is confusing.
Also each plugin file that is present in
`.local/share/profanity/plugins` will then be auto loaded. Which means
after installation.