1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00
Commit Graph

1798 Commits

Author SHA1 Message Date
Michael Vetter
6b597f6608 Fix typos 2023-04-03 17:27:37 +02:00
John Hernandez
99c9f150f6 Fix PGP
Fix of PGP and potentially other encryption methods by calling correct function that would initiate them in case if someone writes.
2023-03-31 12:30:51 +02:00
Michael Vetter
732cbbfefc Add WIN_VCARD to win_get_tab_identifier()
Thanks to 12b997c5f3 we already found a
place where we should add this missing window type.
AFAIK there can be only one vcard window.
2023-03-23 10:33:54 +01:00
Michael Vetter
ac440e72d7 Adapt to new g_string_free() usage
Somehow this must have been overlooked when doing
e59c401c84.
2023-03-23 10:33:50 +01:00
Michael Vetter
12b997c5f3 ui: make it easier to find non covered window types
Rewrite `win_get_title()` to using switch without a default case. So the compiler warns us
(`enumeration value ‘WIN_XXX’ not handled in switch`)
in case we add a new window type (WIN_CHAT, WIN_PRIV etc) and forget to
adapt this function.

Add assert() in the end to make compiler happy when he realizes there
the function might have no return value (`control reaches end of
non-void function`). This should ever be reached.

Replace the default value of `win_to_string()`, `win_get_tab_identifier()` as
well, and replace it with an assert.

See discussion started at https://github.com/profanity-im/profanity/pull/1799#discussion_r1142444684
2023-03-23 10:20:04 +01: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
Steffen Jaeckel
2936b09a63 change OMEMO QR code 0 bits to 'space'
This makes the generated QR code a lot better recognizable in my case.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-03-12 17:39:57 +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
MarcoPolo-PasTonMolo
6d266984a4 Fix quote and url autocompletion for MAM and history
After adding MAM quote and url autocompletion wouldn't pick up messages
from MAM or history(from DB) or would have them in the wrong order. This
commit fixes that.

Fixes https://github.com/profanity-im/profanity/issues/1770
2023-02-13 23:40:58 +02: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
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
Martin Dosch
a33d027f49 Improve MAM loading string.
Replaced three dots `...` by a proper ellipsis `…`.
Removed plenking (space between `messages` and ellipsis.
2022-10-22 16:09:39 +02:00
MarcoPolo-PasTonMolo
135a4cd9e6 Fix segfault when loading from MAM
When loading messages from MAM profanity would segfault. Reason was that
we were freeing the timestamp of messages when displaying them and we
needed it for loading MAM.
2022-10-22 12:56:15 +03:00
Michael Vetter
a04031cec9 Apply codigng style on new MAM code 2022-10-21 16:55:18 +02:00
Michael Vetter
5ebd7df7e8 Let users scroll up again
We removed this so that we don't get "[SCROLLED]" in the titlebar when
there is actually not more text available.

But now with MAM we can enable this again so that the user can scroll up
and load more text out of the database.

Maybe this also could use a check.

This reverts commit c84b1b5e5d.
2022-10-21 16:52:07 +02:00
Michael Vetter
3bdc14dbcf Merge MAM improvements from #1724
I think this PR already solves and improves the MAM situation a lot.

What's @MarcoPolo-PasTonMolo still wanted to do in this branch is:
* MAM for mucs
* Check if url and quotes autocompletion works fine
* Check if the api still works fine
* Resolve conflicts

Conflicts are solved with this commit.

MAM for mucs can be another feature PR.

The rest we can check while being on master. And more people can help
testing.
2022-10-21 13:30:43 +02: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
Michael Vetter
a86e86cce0 Fix first start detection
Only display help message on first start.
This is a fixup for:
27a5c9d287
2022-10-11 16:39:55 +02:00
MarcoPolo-PasTonMolo
d692aec32e Don't notify on MAM messages 2022-08-20 23:03:46 +03:00
MarcoPolo-PasTonMolo
a704838152 Handle late delivery 2022-08-20 22:48:02 +03:00
MarcoPolo-PasTonMolo
72f613a014 Handle MAM when chatwin gets created from incoming message 2022-07-10 12:28:14 +03:00
MarcoPolo-PasTonMolo
85aaf40432 Have ability to scroll through history even without MAM 2022-07-10 11:17:35 +03:00
MarcoPolo-PasTonMolo
47b3e528e2 Handle scrolling down when buffer fills up 2022-07-10 11:17:35 +03:00
MarcoPolo-PasTonMolo
b03c3bda98 Cleanup 2022-07-05 11:30:04 +03:00
MarcoPolo-PasTonMolo
4d6e95d691 Add loading history message on initial MAM request
This prevents scrolling to top and initiating another MAM request while
still fetching the initial one.
Also free timestamp object in database.c
2022-07-05 11:12:29 +03:00
Michael Vetter
27a5c9d287 Display a help message upon first start of Profanity
Explaining how to register/connect/set up an account.
2022-07-05 06:57:11 +02:00
MarcoPolo-PasTonMolo
6429698f18 Fix initial MAM not displaying
Did this by waiting for a batch of MAM messages to arrive before
prepending them to the buffer. Also limited the number of messages
to fetch to 10 so that the user gets more frequent updates.
2022-07-05 00:06:04 +03:00
Michael Vetter
c8b2979dcd Exit *_incoming_msg functions when plain message is empty
Fix https://github.com/profanity-im/profanity/issues/1733
2022-07-04 16:58:16 +02:00
MarcoPolo-PasTonMolo
e9da694265 Add 'Loading messages' message when scrolling up 2022-07-04 12:39:59 +03:00
Michael Vetter
9ef3491228 Let slashguard ignore quoted messages
This let's us whole `/me` messages and other messages starting with `>`.

Fix https://github.com/profanity-im/profanity/issues/1732
2022-07-04 09:15:03 +02:00
MarcoPolo-PasTonMolo
97a610e915 Fech data from mam when all history gets displayed
Fetch from mam without displaying when all mam messages get received
display new messages from db.
Unstable, initial mam doesn't get displayed unless we start scrolling.
2022-07-03 21:30:02 +03:00
MarcoPolo-PasTonMolo
ea83165a35 Get messages from history when scrolling up. 2022-07-03 21:29:36 +03:00
Michael Vetter
c84b1b5e5d Don't scroll if not needed
If we are in a window with a lot of text and press PAGE UP we scroll up
and write [scrolled] in the titlebar.

So far we also wrote [scrolled] in there even when actually nothing
happened. Like when opening a new window (/msg someone) and there is no
text inside.
2022-06-29 13:50:04 +02:00
Michael Vetter
c0e27f5e72 Fix formatting 2022-06-22 13:10:42 +02:00
Michael Vetter
b302c604ab Display log level information in preferences 2022-06-22 13:05:11 +02:00
Michael Vetter
918d060817 Display mood preferences 2022-06-22 11:45:13 +02:00
MarcoPolo-PasTonMolo
f1d1a80d07 Fix build without omemo 2022-06-17 15:51:45 +03:00
MarcoPolo-PasTonMolo
e4e53d6e01 Don't forget encryption status for OX and PGP.
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
2022-06-17 15:43:54 +03:00
Michael Vetter
35d10868f4 Reset buffer correctly 2022-06-15 15:09:38 +02:00
swirl
7276db07f4
remove memset in cons_show_qrcode
Signed-off-by: swirl <swurl@swurl.xyz>
2022-06-15 08:36:24 -04:00
swirl
7ed944254f
remove VLAs in OMEMO QR Code function
Removes the use of VLAs in favor of calloc

Signed-off-by: swirl <swurl@swurl.xyz>
2022-06-14 21:04:26 -04:00
Michael Vetter
4d6bc1adf8
Merge pull request #1717 from MarcoPolo-PasTonMolo/fix/chat-with-self-duplicate-msgs
Fix duplicate messages in chat with oneself.
2022-06-11 12:33:56 +02:00
Michael Vetter
2e85f18cd6 Use our omemo sid/fingerprint in qr code
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
2022-05-31 15:44:44 +02:00
MarcoPolo-PasTonMolo
91e8a89b59 Fix duplicate messages in chat with oneself.
Messages would get duplicated when you chat with yourself, worse if you
had omemo enabled the duplicated message would say something along the
lines of "Your client doesn't support OMEMO". The cause was carbons
when the message was sent from another client, whilst it was a sent
and received message when profanity was the one to send it. This commit
ignores the carbon message in the 1st case and ignores the received one
in the 2nd.

Fixes https://github.com/profanity-im/profanity/issues/1595
2022-05-31 15:55:02 +03:00
Michael Vetter
42fb8f86d9 Add command help for omemo qrcode 2022-05-30 18:04:42 +02:00
swirl
d64cb38240 Reverse QR code colors and add padding
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>
2022-05-30 18:04:42 +02:00
swirl
9a9a97868d implement working OMEMO QR code
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>
2022-05-30 18:04:42 +02:00
Michael Vetter
cf83976b51 Add basic qrcode functions 2022-05-30 18:04:36 +02:00
Michael Vetter
1330ad4e1e Update copyright year 2022-05-09 15:43:33 +02:00
Michael Vetter
b16bdca726 ox: show ox preferences 2022-05-05 23:55:31 +02:00
Michael Vetter
be55b16bef Restore default behaviour for stamps
@mdosch discovered that we now don't print `:` for messages from others
anymore.

Until
https://github.com/profanity-im/profanity/pull/1663#issuecomment-1114625151
is fixed lets restore the default behaviour to always add `:` in
`_win_print_internal()`.

The result will be that a stamp set to `-->` will also look like `-->:`.
2022-05-03 12:17:29 +02:00
Michael Vetter
27f25172e9
Merge branch 'master' into add_stamp_settings 2022-04-28 19:33:23 +02:00
Michael Vetter
6c5d983f13 Rename stamp preference variable
PREF_INCOMING_STR -> PREF_INCOMING_STAMP
PREF_OUTGOING_STR -> PREF_OUTGOING_STAMP
2022-04-28 19:29:27 +02:00
Stefan Ott
8044c82614 Add support for offline MUC notifications 2022-04-23 02:42:23 +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
Artjom Vejsel
2c003dd2e1 add /stamp command
command allow override standard stamps of incoming and outgoing messages
2022-04-02 00:23:08 +03:00
Paul Fertser
4290d87df9 Use correct colour for their nick when showing history 2022-04-01 17:14:48 +03: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
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
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
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
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
2c7f52f81d
Merge pull request #1652 from profanity-im/fix-1624
Fix #1624
2022-03-23 13:02: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
MarcoPolo-PasTonMolo
fb790a955b Use funcs available in all glib versions to replace \n in quotes 2022-03-21 14:52:17 +02:00
MarcoPolo-PasTonMolo
06ef6842e8 Add quote autocompletion for previous messages
Fixes https://github.com/profanity-im/profanity/issues/1649

Type `>` then press tab or shift tab to autocomplete previous messages,
then type your reply and send message.
Newlines are replaced with newline followed by `> `.
A newline is added at the end so that the user can immediately type a
message without manually adding a new line.
2022-03-21 13:46:50 +02:00
Michael Vetter
963065775b
Merge pull request #1646 from MarcoPolo-PasTonMolo/fix/nick-autocomplete
Fix not autocompleting nicks with '/'
2022-03-21 10:06:29 +01:00
MarcoPolo-PasTonMolo
ffeb8c33f1 Reverse priority for nick vs cmd autocomplete 2022-03-21 00:12:12 +02:00
Steffen Jaeckel
07e584734d Alt+e is already bound, use Alt+c
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-13 13:21:40 +01:00
MarcoPolo-PasTonMolo
3f78af2591 Move get_message_from_editor to appropriate file and change its keybinding 2022-03-03 12:56:03 +01:00
MarcoPolo-PasTonMolo
0fdaad7cbf Add hotkey for sending readline text to editor 2022-03-03 12:55:57 +01:00
MarcoPolo-PasTonMolo
1afe2aad24 Fix not autocompleting nicks with '/'
Remove check for '/' at the beginning of the line before autocompleting
and make it fallback to command autocompletion if no nicks found.

Fixes https://github.com/profanity-im/profanity/issues/1474
2022-03-03 09:59:21 +02:00
Steffen Jaeckel
9cf78e59d5 auto-format
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-02-01 15:01:28 +01:00
Steffen Jaeckel
d2ba0e0833 auto-format
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2021-10-27 22:45:44 +02:00
Michael Vetter
56846a5b77
Merge pull request #1607 from profanity-im/utf8indicatorchar
Allow more UI indicator signs to be utf8 "characters"
2021-10-22 17:08:14 +02:00
Michael Vetter
a9bcc8e8bd Allow utf8 in occupants header char 2021-10-22 16:54:05 +02:00
Michael Vetter
1c96115f97 Allow utf8 in occupants char 2021-10-22 16:54:05 +02:00
Michael Vetter
fa2881fcea Allow utf8 in roster room private char 2021-10-22 16:54:05 +02:00
Michael Vetter
8fc359ba2d Allow utf8 in roster rooms char 2021-10-22 16:54:05 +02:00
Michael Vetter
7faf15a18c Allow utf8 in roster private char 2021-10-22 16:54:05 +02:00
Michael Vetter
83ee4a27cb Allow utf8 in roster resource char 2021-10-22 16:54:02 +02:00
Michael Vetter
a668ca45b7 Allow utf8 in roster contact char 2021-10-22 16:23:18 +02:00
MarcoPolo-PasTonMolo
da3a6d8743 Move declaration and definition of win_get_last_sent_message to the correct place 2021-10-22 10:24:51 +03:00
Michael Vetter
91898597dd Allow utf8 in roster header char
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:
1f8b1eb740
5cf6ee1bc6
2021-10-21 15:30:01 +02:00
Michael Vetter
f21595597f Format code correctly 2021-10-05 10:01:27 +02:00
Michael Vetter
242696f09a Fix fromat string in statusbar
Regards https://github.com/profanity-im/profanity/issues/1597#issuecomment-930540261
2021-09-29 23:25:38 +02:00
Michael Vetter
e5b6258c99 Fix wrong format string in titlebar
See
fd9ccec8dc
and
https://github.com/profanity-im/profanity/issues/1597#issuecomment-930426764.
2021-09-29 20:17:41 +02:00
Michael Vetter
fd9ccec8dc Fix wrong format string in titlebar encryption
Fix https://github.com/profanity-im/profanity/issues/1597

Thanks @debacle.
2021-09-29 15:48:09 +02:00
Michael Vetter
31d72689c7 Add more keybindings to /help navigation 2021-09-15 11:29:20 +02:00
Michael Vetter
8c4ce7a939 notifier: Use glib function 2021-09-09 09:48:04 +02:00