1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00
Commit Graph

5011 Commits

Author SHA1 Message Date
Michael Vetter
196fdd9cb9
Merge pull request #1699 from profanity-im/1698-fixoxabrt
Fix SIGABRT when using wrong argument order for receiving ox key
2022-04-27 16:51:39 +02:00
Michael Vetter
8ee3a43983 ox: remove comment 2022-04-27 16:36:30 +02:00
Michael Vetter
c8b88733ef ox: print invalid fingerprint instead of aborting
Asserting here is not the right thing to do at all.
A person could have a typo in the fingerprint. Or like in the case of
the reported bug just confuse the arguments.

An additional check for valid jid should be added later to the calling
function maybe.

Fix https://github.com/profanity-im/profanity/issues/1698
2022-04-27 16:30:01 +02:00
Michael Vetter
866f688621 ox: print bad usage instead of custom message 2022-04-27 16:13:05 +02:00
Michael Vetter
ecafb6deaf Remove comment 2022-04-27 16:08:39 +02:00
Michael Vetter
f891edc0e9 Fix typo Annonuce -> Announce 2022-04-14 09:23:12 +02:00
Michael Vetter
0293b639c7 Fix typo: paylod -> payload 2022-04-12 20:52:39 +02:00
Paul Fertser
8e728fee15 Show return symbol for embedded newlines
When editing multi-line messages or comments everything past the first
newline becomes invisible.

This patch fixes it by substituting a Unicode symbol for "return"
instead of printing the newline as is. On locales where it's not
available single backslash is used instead.
2022-04-12 12:17:36 +03:00
Paul Fertser
ccede06a65 Handle input win redisplay via Readline hook
Allow Readline to control when to redisplay the input line. This makes
text entered via /editor visible after editor is closed.
2022-04-12 12:17:36 +03:00
Paul Fertser
026522534b Show Readline prompt in input window
When doing an interactive search the prompt is needed to show the
current state of the search to avoid confusion.
2022-04-12 12:17:32 +03:00
Paul Fertser
b00e74f3b8 Allow /editor while not connected
Since /editor can be used also for commands it doesn't make sense to
restrict it to only connected state.
2022-04-12 11:42:50 +03:00
Michael Vetter
59b9b44d53 Dont show presence status changes by default
Dont show presence status changes by default in chat and muc windows.

Users repeatedly ask how to change this setting in the MUC.
We have it in the FAQ since a long time.

And most people I know change this setting, including me.

So it looks like it's time to change this default.
2022-04-07 17:32:37 +02:00
Michael Vetter
db154f226e
Merge pull request #1674 from paulfertser/allow-bold-for-default-colours
Allow bold for default colours
2022-04-04 23:38:31 +02:00
Michael Vetter
55cc76450b
Merge pull request #1681 from akaWolf/fix_theme_load_non_exist
Fix theme load

When we execute `/theme load somethingthatdoesntexist` it still loaded some colors wrongly.
2022-04-03 23:36:39 +02:00
Michael Vetter
dfa3ca344b
Merge pull request #1675 from paulfertser/fix-no-me-history
Use correct colour for their nick when showing history
2022-04-03 03:15:25 +02:00
Artjom Vejsel
9c2713c917 disable execution of colors-changing code when call for theme load and it doesn't exist 2022-04-02 19:07:59 +03:00
Maxi Wuttke
373385e90e Include config.h in src/config.cafile.c
See <https://github.com/profanity-im/profanity/issues/1512>
2022-04-02 01:15:34 +02:00
Maxi Wuttke
f11ad16714 Fix a segfault when uploading or downloading files
The variable `ccount->tls_policy` was not null-tested before `strcmp`.
2022-04-02 01:15:34 +02:00
Paul Fertser
4290d87df9 Use correct colour for their nick when showing history 2022-04-01 17:14:48 +03:00
Paul Fertser
4217105ff0 Allow bold for default colours 2022-04-01 17:00:13 +03:00
Steffen Jaeckel
7da2e6d9f3 Fix logging (this time for real)
... I hope ...

We also need to create the path where the logs are stored.

Fixup of d82f2f293b

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-04-01 14:56:08 +02:00
Steffen Jaeckel
d82f2f293b fix path where logs are stored
43e5f15e66 broke the creation of the path
where chatlogs are stored. This is fixed now.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-04-01 14:17:44 +02:00
Michael Vetter
ba3d5e8de9
Merge pull request #1664 from paulfertser/tab-completion-cleanup
Tab completion code simplification
2022-04-01 12:52:54 +02:00
Michael Vetter
129886454c
Merge pull request #1667 from paulfertser/fix-screen-arrows-bindings
Add Alt/Ctrl-arrows combinations for GNU Screen
2022-04-01 12:50:47 +02:00
Michael Vetter
eed5e8a652
Merge pull request #1669 from paulfertser/make-rl-functions-bindable
Make all existing input functions bindable from config
2022-04-01 12:50:29 +02:00
Michael Vetter
1bd0e4ddf5
Merge pull request #1670 from profanity-im/moar-cleanup
Even moar cleanup
2022-04-01 12:23:56 +02:00
Steffen Jaeckel
b914929320 fix account set theme help
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-04-01 11:03:28 +02:00
Paul Fertser
e1323655ee Fix race condition on resize
The current code is inherently racy: if screen update takes
considerable time (e.g. when working over network) and a user
performed a series of resizes the final event might get ignored and
the display will be left in inconsistent state.

Fix the race by unsetting the flag first so if the next WINCH signal
is received while display is resizing it'll be processed on the next
iteration.
2022-04-01 10:49:01 +03:00
Steffen Jaeckel
1c7bae4ae9 fix linter warnings
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-31 14:29:56 +02:00
Steffen Jaeckel
f284641710 less duplication
Print error message from `_string_matches_one_of()` instead of forming
an error message manually that contains the same entries that were checked
in `_string_matches_one_of()`.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-31 14:29:56 +02:00
Steffen Jaeckel
c53b78ea1c use _string_matches_one_of() at more places
I missed them the last time ...

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-31 10:33:14 +02:00
Paul Fertser
54c00e206d Make all existing input functions bindable from config 2022-03-30 23:00:14 +03:00
Paul Fertser
4a6f88cc23 Add Alt/Ctrl-arrows combinations for GNU Screen
GNU Screen terminal emulator is modelled after VT100, its key bindings
for "application mode" (which profanity enables on startup) can be
seen with this: info screen "Input Translation".
2022-03-30 21:46:25 +03:00
Steffen Jaeckel
2ca63d1d5f run make format
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-30 18:26:10 +02:00
Steffen Jaeckel
2995fbb953 add _string_matches_one_of() helper function
... instead of copying the same pattern over and over again.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-30 18:26:10 +02:00
Steffen Jaeckel
3a03496817 clean-up connection (act I)
* use custom memory descriptor that `abort()`s on `malloc()` failure
* use static log descriptor
* don't always re-create all contexts
* de-duplicate code of `.._connect()` and `.._register()`

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-30 18:26:10 +02:00
Paul Fertser
3b40da854d Tab completion code simplification
Factor out common code for Tab and Shift-Tab in a separate function.

No functional change.
2022-03-30 16:36:10 +03:00
Paul Fertser
1e81eea899 Input window: handle invalid multibyte
The current code enters an infinite loop if the input string happens
to get an invalid utf-8 sequence somehow. For me it was reproducible
by running profanity in a Screen session and pressing Alt-т (cyrillic
letter).

Fix it the way borrowed from 0501e49623
where mbrlen is used for the same purposes.
2022-03-29 13:57:07 +03:00
Michael Vetter
92f1ba47df
Merge pull request #1656 from MarcoPolo-PasTonMolo/feature/who-none
Add none option for /who
2022-03-29 01:28:58 +02:00
Paul Fertser
1272543237 Use EDITOR environment variable
When preferences do not specify a program to be used for /editor
command, try getting it from EDITOR (which POSIX.1-2017 calls one of
"variables that are frequently exported by widely used command
interpreters and applications"), fall back to "vim" if not set.
2022-03-27 21:48:45 +03:00
MarcoPolo-PasTonMolo
03f8db9658 Add none option for /who
Fixes https://github.com/profanity-im/profanity/issues/1425
`/who none` now displays all users in an muc without an affiliation
2022-03-27 16:06:29 +03:00
Michael Vetter
409268e2b6
Merge pull request #1655 from profanity-im/win-autocomplete
Reset url autocompletion after open/save
2022-03-24 20:30:40 +01:00
Michael Vetter
923af3ba38 Reset url autocompletion after open/save
I guess we should reset the position after we ran `/url open|save`.
So that next time `/url open <tab>` starts with the latest entry.

Fix https://github.com/profanity-im/profanity/issues/1654
2022-03-24 15:39:58 +01:00
MarcoPolo-PasTonMolo
ce152a82b4 Fix crash on /editor 2022-03-24 11:42:49 +02:00
Michael Vetter
2c7f52f81d
Merge pull request #1652 from profanity-im/fix-1624
Fix #1624
2022-03-23 13:02:01 +01:00
Steffen Jaeckel
3a86b8c29b apply tls.policy to cURL calls
In case the user decides to ignore the validity-state of certificates
we also have to configure libcurl accordingly.

`tls.policy` can be set via
```
/account set <account> tls trust
```

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-22 11:44:01 +01:00
Steffen Jaeckel
7f1f9787cb add profanity-specific CAfile
The profanity-internal mechanism to allow connecting to a server isn't
easily portable to cURL. Therefor introduce a profanity-specific CAfile
which is managed individually and will be configured in libcurl calls.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-22 11:44:01 +01:00
Steffen Jaeckel
b28ac09368 a tad more const-correctness
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-22 11:44:00 +01:00
Steffen Jaeckel
7c56eac154 also store PEM in TLSCertificate
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-22 11:34:23 +01:00
Steffen Jaeckel
44e65f3089 simplify code
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-21 14:33:30 +01:00