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
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
Michael Vetter
c397657061 Change attentionflag shortcut to alt+v
alt+f is the default readline shortcut for forward one word.

Regards https://github.com/profanity-im/profanity/issues/1580
2021-08-31 22:25:29 +02:00
Dmitry Podgorny
2e0adbd004 chatwin: fix memory leak when load history
_chatwin_history() reassigns msg->plain without freeing previous
string. This leads to memory leak. As a temporary solution, free
replaced string.

Fixes #1585.
2021-07-20 22:15:57 +03:00
Dmitry Podgorny
c0ea27f2f0 Don't handle /me in the middle of a message with mentions 2021-07-17 19:36:31 +03:00
Dmitry Podgorny
a5d15e224c Fix buffer overread in _mucwin_print_mention()
Offset for g_utf8_substring() is higher than the string length. We can
avoid g_utf8_substring() for the tail and simply convert starting offset
to a pointer.
2021-07-17 19:33:28 +03:00
Michael Vetter
06482fdaef Add option to only allow messages from jids in roster
`/silence on` will throw away all messages (type: chat, normal) that
come from jids that are not in the roster.

Implement https://github.com/profanity-im/profanity/issues/955
2021-07-01 18:02:03 +02:00
Michael Vetter
dc79c514be Fix /disco info contact address header
Only display server contact information heading when we have actual
addresses.
2021-06-30 13:58:28 +02:00
Michael Vetter
3d5e59895b Adjust contact addresses output to the rest of disco info
Format the output of cons_show_disco_contact_information() so that it matches cons_show_disco_info().
2021-06-30 11:30:02 +02:00
Michael Vetter
817a6bff54 XEP-0157: Print all available addresses 2021-06-30 11:23:22 +02:00
Michael Vetter
ef96bea82e XEP-0157: Print contact addresses 2021-06-30 10:45:59 +02:00
Michael Vetter
fc593ef90e Print editor command in /executable overview 2021-06-10 17:28:29 +02:00
Michael Vetter
86aec9d068 win unread: fix window test
Fix https://github.com/profanity-im/profanity/issues/1554
2021-06-09 18:41:56 +02:00
Michael Vetter
8ef35290bd Add command to show single bookmark details
`/bookmark list` lists all bookmarks with its details.
`/bookmark list <jid>` shows the details of a single bookmark.

Implement https://github.com/profanity-im/profanity/issues/1558
2021-06-09 15:53:21 +02:00
Michael Vetter
f20f629bb4 Fix multiple mentions in one line
`jubalh: jubalh jubalh` resulted in `20:32:34 - testuser1:
jubalh20:32:34 - testuser1: :  jubalh20:32:34
- testuser1:  jubalh`

Print date/nick only once at beginning of line.
2021-06-08 20:34:24 +02:00
Michael Vetter
6bc440c6f7 Use utf-8 safe functions in _mucwin_print_mention()
get_mentions() correctly counts utf-8 chars. So the positions of
mentions we get from there are correct.

But in _mucwin_print_mention() we set position equal to byte.
We need to use utf-8 safe functions here.

Regards https://github.com/profanity-im/profanity/issues/1231
2021-06-08 19:42:41 +02:00
Michael Vetter
c815547cba Change restarted omemo text 2021-06-02 13:10:42 +02:00
DebXWoody
b235eb2351
Restart OMEMO Session after lost connection
When the connection has been re-established, chat and groupchat with OMEMO
should restat the OMEMO Session.

Fix: #1530

* Added HAVE_OMEMO
* clang-format and user output
2021-06-02 06:54:41 +02:00
Michael Vetter
6df062b542 Change ui_win_has_attention() logic 2021-05-31 09:51:23 +02:00
Michael Vetter
2bfe11ed82 Display attention hint in titlebar for mucs too
* Display the `[ATTENTION]` hint in the titlebar for both chatwins and
mucwins.
* Use THEME_TITLE_TEXT instead of THEME_TITLE_ENCRYPT
* Have separate function `_show_attention` and don't do it in unrelated
  `_show_privacy`.
2021-05-31 09:41:18 +02:00
DebXWoody
47e39a7975
Attention-flag: Fix next window 2021-05-29 22:01:44 +02:00
DebXWoody
b0a89db1d6
Attention flag message ( enabled, disabled)
When the user enables or disabled the attention flag, a message will be
displayed in the chat window.
2021-05-29 20:44:17 +02:00
DebXWoody
1526a00123
Attention flag - Implemented Alt+m 2021-05-29 20:16:21 +02:00
DebXWoody
6dd11f0fff
Attention flag for groupchats
Attention flag for groupchat and display the windows via "/wins attention"
2021-05-29 09:30:13 +02:00
DebXWoody
3520645366
Attention flag for chat windows
User is able to toggle a flag for chat windows. This flag should be used to mark
the window for "Attention".

Use Ctrl+f to mark the window.
2021-05-29 08:05:03 +02:00
Michael Vetter
1d8061e89b Have separate settings for intype
Old: `/intype on|of`
Typing information is printed in console and titlebar.

New: `/intype titlebar|console on|off`
Typing information can be configured in more detail.

Regards https://github.com/profanity-im/profanity/issues/1516
2021-05-08 19:38:40 +02:00
Dustin Lagoy
9d404971da Apply pre_chat_message_display hook to history 2021-04-27 20:42:30 -04:00
Maximilian Wuttke
9e0d0ed466 OMEMO: Remove duplicate session initalisation
The function `omemo_start_session` was effectively called twice in the
`/msg` command: Once in `chatwin_new` and afterwards in `cmd_msg`. I've
removed the second call.
2021-04-08 00:23:07 +02:00
Michael Vetter
1ec606540e Get rid of asprintf and _GNU_SOURCE define
_GNU_SOURCE was even in some files where it was not needed at all
(http*).

Let's replace asprintf() with g_strdup_printf().
2021-03-30 17:38:13 +02:00
Michael Vetter
057c9ad776 Add config.h in files were it was missing
Related to https://github.com/profanity-im/profanity/issues/1512
2021-03-26 19:54:22 +01:00
Thorben Günther
71236a0d5a
Update ui_ask_password to support confirmation
Just prints a different string to console.
Useful for changing passwords or account registration.
2021-03-11 14:40:17 +01:00
Michael Vetter
c8dba32760
Merge pull request #1495 from xenrox/offline-members
MUC: Show offline members in sidebar
2021-03-08 15:35:28 +01:00
Thorben Günther
f1780f0017
MUC: Show offline members in sidebar 2021-03-08 14:34:59 +01:00
Akce
f3e080e268
Draw wintitle using fputs and fprintf instead of /bin/echo. 2021-02-28 07:43:26 +11:00
Stefan
45e4d26296 Bugfix: Titlebar show name without room name
Error log:
GLib-CRITICAL - g_string_insert_len: assertion 'len == 0 || val != NULL' failed

Check if a room name exists, before adding the name into the title bar.
2021-02-14 21:00:05 +01:00
Michael Vetter
44fc3f0506 Add /mam command
Regards https://github.com/profanity-im/profanity/issues/660
2021-01-28 15:11:50 +01:00
Michael Vetter
a01c963b46 Simplify console notification code
Functions had some duplicate code:
* cons_show_incoming_room_message()
* cons_show_incoming_message()
* cons_show_incoming_private_message()
2021-01-21 10:20:34 +01:00
Michael Vetter
8c08e64f37 Update copyright 2021-01-08 16:36:30 +01:00
kaffeekanne
97dd1cb0c2 Set input window size to max window size
Input window size was one cell off, therefore terminal themes with background color set were rendered incorrectly, fixes #1458
2020-12-11 20:33:01 +01:00
kaffeekanne
4e999283f0 Remove blank line after trackbar
Remove added blank line after trackbar, introduced by 606c1e51e6
2020-12-11 16:10:26 +01:00
Michael Vetter
63843342c3 Remove old TODO
It was added in f7fe87dd4e when I rewrote
window functions to include more infos (not just char* but whole jid
struct I think).
The same todo was added to win_print_outgoing_muc() but removed in
f3d9de133e.

This TODO should have been removed in
f3d9de133e since there we added the myjid
parameter.
2020-12-11 13:47:40 +01:00
Michael Vetter
d5415b99a6 Fix color for win_print_outgoing()
Discovered by @aba-hollerer.

Mistake was introduced in b6b7dd5ad4
probably due to a wrong copy/paste.

First wasn't reproducible because I had `/receipts request on` and thus
win_print_outgoing_receipts() is used which has the correct
THEME_TEXT_ME.

Fixes https://github.com/profanity-im/profanity/issues/1441
2020-12-11 12:14:27 +01:00
Michael Vetter
b12183aa1a Remove empty line 2020-12-10 14:40:25 +01:00
Michael Vetter
3703879a1c Remove not needed initialization in chatwin_new()
00dbc1ba7c attempted to fix
https://github.com/profanity-im/profanity/issues/1449.

Here we revert the part about initializing is_omemo in chatwin_new()
since this is done in win_create_chat() already.

The actual mistake was the wrong cast of the muc window which is fixed
by the same commit. The mistake was introduced in in 3370418d71.

While being at it we also remove the is_ox initialization since this is
handled in win_create_chat()/win_create_muc() too.
2020-12-10 14:23:47 +01:00
Michael Vetter
a94378f206 Fix various typos 2020-12-10 09:24:32 +01:00
William Wennerström
00dbc1ba7c
Cast chat/muc window to correct type and refactor cmd_sendfile
Fixes #1449
2020-12-09 19:02:37 +01:00
Michael Vetter
ad7366994a Simplify notify() 2020-12-09 11:01:16 +01:00
Michael Vetter
606c1e51e6 Expand trackbar to whole line
Fix https://github.com/profanity-im/profanity/issues/1448
2020-12-09 10:21:32 +01:00
William Wennerström
d7848e38bc
Remove scheme and filetype matching for url (save|open) 2020-12-08 20:01:17 +01:00
William Wennerström
7f0165a912
Fix segfault for urlopen[1] 2020-12-07 16:46:44 +01:00
William Wennerström
4a1c118b8b
Fix bad order of parameters for url save 2020-12-07 15:15:06 +01:00
William Wennerström
3a6597ee29
Refactor for threaded external executable for built-in download methods 2020-12-03 16:54:06 +01:00
William Wennerström
4711fc62a3
Run make format on rebase 2020-11-16 21:58:09 +01:00
William Wennerström
9499df6585
Add http_download tool 2020-11-16 21:58:09 +01:00
William Wennerström
9d58472c8c
Remove /omemo sendfile 2020-11-16 21:58:08 +01:00
Michael Vetter
35aecd425f Declare counter var inside loop
We require c99/gnu99 anyways.
2020-11-09 11:33:33 +01:00
Philipp Klaus Krause
6a276e74e3 Since the string from strerror should never be modified, use const. 2020-10-14 09:52:26 +02:00
Dmitry Podgorny
64df8630d4 Fix use-after-free which is introduced in cons_alert()
Commit f12161f fixes memory leak, but introduces use-after-free issue.
Allocate new memory for win_name with g_strdup() since it is freed with
g_free() later.
2020-10-09 13:39:52 +03:00
Michael Vetter
f12161f190 Fix memleak in cons_alert()
Close https://github.com/profanity-im/profanity/issues/1427
2020-10-07 22:50:24 +02:00
nia
ce67753423 Avoid passing NULL pointers to curses functions.
This allows profanity to work without segfaulting from NULL
pointer dereferences when used with NetBSD libcurses.

Basic functionality was tested, there may be more NULL pointer
issues hiding.
2020-09-04 12:59:20 +02:00
nia
52e9be4abc Basic support for building on NetBSD.
- Add NetBSD as a recognized platform without -ldl.
- Allow building with NetBSD libcurses instead of ncurses.
- Portability to NetBSD sh - use POSIX '=' instead of '=='.
2020-09-04 12:55:20 +02:00
Michael Vetter
5db840e0cc Fix memleak in win_print_outgoing_with_receipt()
We should actually process the receipts also in LMC I think.

Regards https://github.com/profanity-im/profanity/issues/805
2020-07-23 10:06:49 +02:00
Michael Vetter
95ab7ee062 Setting: only write in console upon muc mention
`/console muc mention` additionally to `first|none|all`.

Fix https://github.com/profanity-im/profanity/issues/1371
2020-07-10 15:16:34 +02:00
Michael Vetter
7b49fbdf45 Pass window to functions so we dont have to call twice 2020-07-09 16:11:50 +02:00
Michael Vetter
11d849aa7f Dont hilight console once all messages have been read
If we receive a message we get:
<< room message: eagle@conference.anoxinon.me (win 2)

Same for private chats and regular chats.
And several other kinds of notifications.

If we only receive notifications from a chat window it would be nice to
also clear the hilight on the console window since we already catched up
by reading the actual message in the chat window.

Probably not the best description :-) I hope you get it..

Regards https://github.com/profanity-im/profanity/issues/1399
2020-07-09 15:44:35 +02:00
Michael Vetter
8a2026ccbe Make _show_roster_contacts static 2020-07-09 08:48:10 +02:00
Michael Vetter
a2726b6a7d Apply coding style 2020-07-07 14:18:57 +02:00
Michael Vetter
a4cadf78fa Revert "Apply coding style"
This reverts commit 9b55f2dec0.

Sorting the includes creates some problems.
2020-07-07 13:53:30 +02:00
Michael Vetter
9b55f2dec0 Apply coding style
Regards https://github.com/profanity-im/profanity/issues/1396
2020-07-07 09:43:28 +02:00
Michael Vetter
e5ac12afa6 Remove prefs_free_string()
It just does a free.
Related to b580b9ef11
2020-07-02 11:34:12 +02:00
Michael Vetter
9774b0c550
Merge pull request #1374 from profanity-im/revampUrlopen
Rework /url and /executable for filetypes
2020-07-02 11:26:18 +02:00
Michael Vetter
86cd33405e Add note that /executable needs more work 2020-07-02 11:18:37 +02:00
Michael Vetter
59f5b81b85 cmd_url_*(): use gchar instead of char 2020-07-02 10:58:31 +02:00
Michael Vetter
8be1e44cea Adjust /executable test to be more precise 2020-07-01 15:42:26 +02:00
Michael Vetter
2b5160a351 console.c: Use prefs_free_string()
f9961677aa  replaces prefs_free_string()
with g_free(). Both is correct but lets still use this.
2020-07-01 14:50:07 +02:00
Stefan Kropp
7d6ef8f4c8 Initialize is_ox in win_create_chat()
Fixes an issue where messages are displayed as OX when they are not.
2020-07-01 09:23:23 +02:00
DebXWoody
2c94ee5a88 Feature request - XEP-0373: OpenPGP for XMPP (OX)
Basic implementation of XEP-0373: OpenPGP for XMPP.
https://xmpp.org/extensions/xep-0373.html

Command /ox

Issue: #1331
2020-06-29 19:05:41 +02:00
Pierre Mazière
f9961677aa Display default value for /url associated commands
The display of commands associated with specific file
types and protocols will need to be implemented later,
but this requires to use private data of the GKeyFile
structure, which can be a maintainability issue on the
long term.

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-06-25 15:03:20 +02:00
Pierre Mazière
64eb11fbaf Add aesgcm to urls grabber
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-06-25 15:02:56 +02:00
Dmitry Podgorny
09e12a826f Fix gcc warnings for cygwin
strncpy(3) is not so safe function and can lead to mistakes. For
example, strncpy(dest, "Profanity", 10); is redundant and leads to
problems when someone changes the source string.

Different example is when 3rd argument equals to length of the
destination buffer. strncpy(3) doesn't terminate string with '\0' when
it truncates. Therefore, the destination string becomes corrupted.

Zeroize storage for 'nid', so the last byte remains '\0' in case of
truncate.
2020-06-24 16:29:19 +03:00
Michael Vetter
74e061165a Define POSIX macro to have strdup
98c38dc6d6
sets C99 as standard.

strdup() is not part of C99.

For now set `-D_POSIX_C_SOURCE=200809L` macro to have strdup() in C99.
Using `gnu99` instead would be another option.

We should take more care to use glib functions whenever possible.

Regards https://github.com/profanity-im/profanity/issues/1357
2020-06-12 16:12:21 +02:00
Dmitry Podgorny
ac410445af Add option for legacy authentication
New options:
  /connect <account> [auth default|legacy]
  /account <account> set auth default|legacy

Fixes #1236.
2020-06-05 11:37:51 +03:00
Michael Vetter
bfaf737efa urlopen: get last URL first
Fix https://github.com/profanity-im/profanity/issues/1348
2020-05-29 11:26:18 +02:00
Michael Vetter
d251b56166 Fix titlebar write position
Mistake introduced in 86f0e0ea70
The functions later on dont set an explitic position when writing their
strings.

Fix https://github.com/profanity-im/profanity/issues/1346
2020-05-27 08:59:00 +02:00
Michael Vetter
1cfab017a4 Handle listing ignored bookmarks when none are ignored 2020-05-25 13:38:47 +02:00
Michael Vetter
de8975c008 Add and use connection_get_barejid()
Instead of connection_get_fulljid() and then creating a Jid from it.
2020-05-25 13:04:19 +02:00
Michael Vetter
f121554088 List ignored bookmarks
`/bookmarl ignore` lists the ignored bookmarks.

Regards https://github.com/profanity-im/profanity/issues/1115
2020-05-24 17:55:08 +02:00
Michael Vetter
090732ed96 Fix invalid read in titlebar 2020-05-24 13:47:21 +02:00
Michael Vetter
86f0e0ea70 Dont show resource in titlebar if it is too long
Fix https://github.com/profanity-im/profanity/issues/715
2020-05-22 20:42:44 +02:00
Michael Vetter
fad296b79e Display bookmark name
Have field in struct and display the name in `/bookmark list`.

Regards https://github.com/profanity-im/profanity/issues/697
2020-05-22 13:56:00 +02:00
Michael Vetter
cb78ee4665 Make option to allow hiding windows with no messages in statusbar
`statusbar.show.read` can be set to false in the config.
`/statusbar show|hide read`.

Implement https://github.com/profanity-im/profanity/issues/1285
2020-05-21 16:15:14 +02:00
Michael Vetter
fcd69532ad Make 'scrolled' themeable 2020-05-21 09:16:18 +02:00
Michael Vetter
469fa8f863 Display when scrolled up
Display [SCROLLED] in titlebar if a chat/muc/private win is scrolled up.

Implement https://github.com/profanity-im/profanity/issues/1289
2020-05-21 09:14:45 +02:00
Michael Vetter
7b541d0a6d Add /executable command
This is used to set the openers for various commands.
So far for /avatar and /urlopen.
2020-05-20 14:14:49 +02:00
Michael Vetter
aef74f90ec Only save max 20 urls 2020-05-20 10:54:58 +02:00
Michael Vetter
ce32d874e0 Build URL ac upon printing of message in window 2020-05-20 10:54:54 +02:00
Michael Vetter
22ca81e0b6 Look for URLs via regex 2020-05-20 10:47:46 +02:00
Michael Vetter
083bf34a77 Start urlopen feature
Start https://github.com/profanity-im/profanity/issues/1340
2020-05-20 10:47:40 +02:00
Michael Vetter
5cf6ee1bc6 Fix /correction char display
1f8b1eb740 made it possible to have utf8 chars as correction chars. So since then prefs_get_correction_char() doesn't return a regular char but a char*.
Seems like there was an oversight that we need to use %s then.
2020-05-06 13:46:40 +02:00
Michael Vetter
85520ecdc5 Remove unanimous MAM display
For some time users could choose to have the old way "unanimous" where
all the MUC history is just grey (or whatever was set). Now it is always
just displayed like regular new incoming MUC text.
2020-04-25 17:19:02 +02:00
Dmitry Podgorny
4672d0ca19 ui: fix condition
Fix mistake in a condition. Also add sanity check to
win_refresh_with_subwin().
2020-04-23 14:30:49 +03:00
Michael Vetter
4a712fcc7b Fixup for bad56b5062
sorry.. doing too many things at once..
2020-04-22 17:01:27 +02:00