1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00
Commit Graph

7207 Commits

Author SHA1 Message Date
Steffen Jaeckel
7d9c3c1b32 fix "window NULL issue" (hopefully)
There were multiple reports where after a reconnect the window of the
MUC that was last opened, was empty.

`muc_join()` creates an instance of a MUC, `presence_join_room()` works
with this instance. Therefore the instance has to exist before working on
it.

I'm not sure if this really fixes the issue, but at least it didn't
happen anymore after I applied this modification.
I can't remember how I stumbled over this, either while looking at debug
logs or while looking at Valgrind output while a reconnect happened, but
something went wrong. Then I came to the conclusion that this may fix
the issue and for now it did ... maybe it comes back, then my RCA was
wrong.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-05-10 17:51:52 +02:00
Michael Vetter
faccf24c75
Merge pull request #1843 from IsaacM88/master
Add ability to disable avatar publishing
2023-05-03 13:33:00 +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
Michael Vetter
3be09147d7
Merge pull request #1840 from H3rnand3zzz/fix/plugins-unload
Fix `/plugins update`
2023-04-19 17:52:39 +02:00
Michael Vetter
ec87d9ad4e
Merge pull request #1837 from profanity-im/fix/memleakclientcheck
Fix two recently introduced memleaks
2023-04-19 17:51:15 +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
Michael Vetter
f20dbcff09 Fix memleak in _inp_rl_linehandler
Introduced in 59b99fece.
2023-04-18 21:30:05 +02:00
Michael Vetter
abaf96dcef Fix memleak in stanza_create_caps_query_element
Got introduced with 5d3c8ce7c.
2023-04-18 20:26:24 +02:00
Michael Vetter
96f9a84f01
Merge pull request #1835 from H3rnand3zzz/fix/message-logging
Fix crash, add consistency to logging
2023-04-18 18:34:20 +02:00
John Hernandez
96ddb2399e Add logging consistency
Since MUC private messages are not logged by design,
part where this logging happening is removed to add consistency.

Add explanation in comment.
2023-04-18 18:19:47 +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
Michael Vetter
4933d4e4f3
Merge pull request #1827 from H3rnand3zzz/feature/sessions-alarm
New Feature: Session Alarm
2023-04-18 14:43:01 +02:00
John Hernandez
bed5c02c0d Add vscode support to .gitignore 2023-04-18 14:28:30 +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
Michael Vetter
f51dc019bc
Merge pull request #1829 from H3rnand3zzz/fix/readline-history
Don't add the same command twice to history
2023-04-18 09:38:12 +02:00
John Hernandez
59b99fece8 Don't add the same command twice to history
Expected behaviour
When you type
/command
/command
it should be just 1 entry in the history.

Behaviour
All the entries were saved.

Behaviour is changed by introducing check. Before adding to history,
entry now is compared to the last history entry.
2023-04-17 11:29:47 +02:00
Michael Vetter
1b679498b6 doscs: Add terminology section to man page
Let's just define some basic terminology.

In many sections of the /help we actually use these terms.
This should help new users understand what they mean.
2023-04-17 11:25:44 +02:00
Michael Vetter
46cba28292
Merge pull request #1831 from profanity-im/man_enc
Add encryption section to man page
2023-04-17 11:02:44 +02:00
Michael Vetter
ee6bf23b8d Add encryption section to man page
The goal should be that users can make a more informed decision about
which encryption they actually want to use.

We can also use this to document usage details of implementation quirks,
if any.
2023-04-17 10:59:41 +02:00
Michael Vetter
f239f5a071
Merge pull request #1830 from profanity-im/feat/codspellci
Add spellcheck to CI
2023-04-15 12:18:41 +02:00
Michael Vetter
181772bd5c Add spellcheck to CI 2023-04-15 12:03:57 +02:00
Michael Vetter
951df64a43 docs: Add info about different clang-format versions
Make this clear to new users. Since sjaeckel had reservations
on https://github.com/profanity-im/profanity/pull/1828.
2023-04-15 11:50:57 +02:00
Michael Vetter
6eacfcb96e
Merge pull request #1828 from profanity-im/newclang
Use GH action for code style check
2023-04-14 22:01:28 +02:00
Michael Vetter
a1814fd3cb Add another formatting commit to git blame ignore 2023-04-14 21:46:27 +02:00
Michael Vetter
d17bcf619c Format code with clang-format 16 2023-04-14 21:45:21 +02:00
Michael Vetter
663c773bff Switch to clang-format check action
Instead of running clang-format outselves on the old Ubuntu version.
This let's us easily configure which version of clang-format we want to
execute.

Used action:
https://github.com/marketplace/actions/clang-format-check

Properly fix:
https://github.com/profanity-im/profanity/pull/1774
2023-04-14 21:43:31 +02:00
Michael Vetter
9bce23e075 docs: Fix formatting in SECURITY.md 2023-04-14 13:16:32 +02:00
Michael Vetter
a99a4fad3e
Merge pull request #1823 from H3rnand3zzz/fix/msg-crash
Fix memory corruption crash
2023-04-14 13:14:01 +02:00
Michael Vetter
ebec68821f
Merge pull request #1826 from H3rnand3zzz/feature/roster-nickname-remove
Add nickname support for `/roster remove`
2023-04-14 13:13:18 +02:00
John Hernandez
899b26b3bc Cleanup p_ox_gpg_decrypt
In OX implementation gpgme's buffer remains untouched, thus not leading to the crash.

But code can be shorter and more concise.
2023-04-13 17:17:25 +02:00
John Hernandez
5e8f1f9c85 Fix memory corruption crash
Under certain circumstances setting plain_str[len] to 0 might lead to crash
and it does not follow the best practices as well.

This change allows better handling of buffer copying and prevents crash.
2023-04-13 17:16:55 +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
766dc76e33 docs: add SECURITY.md 2023-04-13 15:51:22 +02:00
Michael Vetter
ef3810638f iq: initialize os and os_txt
Let's set this to NULL.

Someone was using `picaur` and got an error about potential
uninitialization. Even though the code is fine let's set this to NULL to
make the compiler happy.

The strange thing was that building manually on the same system worked.

Related to 2e43b0ae62.
2023-04-11 20:19:49 +02:00
Michael Vetter
93fa8467ef
Merge pull request #1822 from H3rnand3zzz/fix/iq-os
Hotfix stanza release
2023-04-11 11:26:45 +02:00
John Hernandez
2e43b0ae62 Fix releases of os and os_txt stanzas
If custom client is not set and include_os is true,
stanzas might be released without initializiting.

This commit fixes it by introducing an additional check
on usage of custom client.

Related to commit e52ca2fbaa
2023-04-10 21:26:10 +02:00
Michael Vetter
4f94898611 Add test/valgrind section to PR template 2023-04-10 20:47:55 +02:00
Michael Vetter
e3820d7037 Add limitation info about /statusbar chat user|jid
While testing https://github.com/profanity-im/profanity/pull/1817
we found that:

```
/statusbar show name (I have this off by default
/msg someone where I chose someone in my roster that has a nick assigned
/statusbar chat jid
```

Will only take effect upon creation or redraw of that tab.
Reason is that we do this in create_tab to limit building this
dynamically.

Let's leave it like it is but add a note to users.
Not worth build that string all the time.
2023-04-10 20:22:40 +02:00
Michael Vetter
e3beac414e
Merge pull request #1817 from H3rnand3zzz/feature/full-jid
JID Display in Titlebar and Fix
2023-04-10 20:21:06 +02:00
John Hernandez
7d290b04d5 Fixes Statusbar tabs and Cleanup
- Fixes statusbar tabs.
Bug: Statusbar used nickname if it was set in roster,
irrelevant to /statusbar chat setting.
Expected behaviour would be using this setting set as "user" to show nickname,
and to show jid with "jid" setting.
Other solution is to give a user control over it with another settings.
- _status_bar_draw_maintext cleaned up, no changes to behaviour
2023-04-10 16:28:44 +02:00
John Hernandez
0740d692dc Improve titlebar flexibility
Before this change, only nickname or JID (if no nickname set) is shown in the titlebar.
Change allows to alter nickname/JID preference
using already implemented /titlebar show jid|name setting.
If both are set to "show", then it is displayed in "nickname <JID>" format.
2023-04-10 11:04:20 +02:00
Michael Vetter
54cf152130 contributing: add note about testing 2023-04-09 21:25:28 +02:00
Michael Vetter
64cb52bef5 Rewrite description for clientid 2023-04-09 18:26:40 +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
Michael Vetter
19921f61c1
Merge pull request #1821 from mdosch/use-proper-ellipsis-char
User proper ellipsis char
2023-04-09 14:10:32 +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
Michael Vetter
ac581c29bf
Merge pull request #1813 from profanity-im/tabmode-irssi
add `/statusbar tabmode actlist`
2023-04-08 18:50:50 +02:00