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

1741 Commits

Author SHA1 Message Date
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
Michael Vetter
bad56b5062 wins_show_subwin(): Add windows type test
Fix https://github.com/profanity-im/profanity/issues/1321
2020-04-22 14:03:29 +02:00
Michael Vetter
813fd637a1 inp_readline() Correct slashguard feature
Protect against invalid reads by checking the length.
2020-04-21 16:47:18 +02:00
Michael Vetter
f27bd92731 Make compiler happy about win_refresh_without_subwin 2020-04-20 16:44:47 +02:00
Michael Vetter
b1d71236fe win_refresh_with_subwin() fixup
Fixup for 86af6925d9
2020-04-20 16:35:13 +02:00
Michael Vetter
fb85cec129 Remove unused func wins_close_current() 2020-04-20 16:16:18 +02:00
Michael Vetter
9e73782f72 _destroy_tab() dont set tab to NULL
Setting the local pointer to NULL has no effect.

_destroy_tab() is used for g_hash_table_new_full() so we cant use a **
and set tab to NULL.
2020-04-20 16:10:24 +02:00
Michael Vetter
86af6925d9 Simplify win_refresh_with_subwin() 2020-04-20 16:09:40 +02:00
Michael Vetter
70683c07ab _mucwin_print_mention(): No need to assign pos 2020-04-20 16:02:19 +02:00
Michael Vetter
b2ec6ba4ce ui_room_join() dont get nick twice 2020-04-20 16:01:05 +02:00
Michael Vetter
785e3f5623 cons_show_aliases() simpify condition 2020-04-20 15:59:31 +02:00
Dmitry Podgorny
1f0159de36 Make _inp_edited() more robust 2020-04-19 00:19:16 +03:00
Michael Vetter
9be7d29f1b Don't expose upload_processes
That's actually not good practise.
Realized this when checking for multiple symbol definition in issue
mentioned below.

Regards https://github.com/profanity-im/profanity/issues/1314
2020-04-17 10:05:09 +02:00
Dmitry Podgorny
b3eea13125 Free GError objects
glib functions can allocate a GError object that must be freed with
g_error_free(). Otherwise a memory leak happens.

There are similar unfixed places in omemo, check:
    grep "&error" src/omemo/omemo.c

Fixes #1304.
2020-04-14 03:26:49 +03:00
Michael Vetter
a42c2a1134 Only print chathistory if regular chat message
MUCPMs and regular chat messages get printed with the same code.
But we don't save MUC PMs in the sqldb, because another jid could use
the same nick the next time.

And if we would take the log out we would need a different routine,
checking for resourcepart too.

Fix https://github.com/profanity-im/profanity/issues/1312
2020-04-13 21:57:28 +02:00
Michael Vetter
51518497e5 Add hidden MAM setting and trigger MAM retrievel when opening new window
Only when we start the conversation.
Not yet when we get messaged and a new window is opened.
Need to have sorting of messages in the window buffer then, I guess.
Also MAM IQ should only be send one time in such a case.

If MAM is enabled history from sql backend will not be shown.

`mam` in profrc enables experimental MAM.
Can change soon again. Don't rely on stuff in this stage ;)
2020-04-12 00:42:02 +02:00
Michael Vetter
dd566d8d56 MAM: Correctly display incoming MAM chat message 2020-04-11 23:56:01 +02:00
Michael Vetter
180ec2b474 Add to_jid field to ProfMessage struct
Is usefult in many cases if we want cleaner code.
Hope this edit didn't break anything though ;-)
2020-04-11 17:11:53 +02:00
Michael Vetter
e23bc38083 Quick and dirty display of MAM messages 2020-04-11 16:05:14 +02:00
Dmitry Podgorny
70ad4d4a38 Fix memory leaks in cons_roster_setting() 2020-04-10 23:43:00 +03:00
Dmitry Podgorny
aa4faf6075 Fix memory leaks in _rosterwin_resources() 2020-04-09 15:17:34 +03:00
Michael Vetter
f42f856d37 Retrieve message type from database
So we don't have to check for MUC another way.
2020-04-08 12:50:23 +02:00
Michael Vetter
5862e5b159 db: Fix memleaks 2020-04-06 16:09:38 +02:00
Michael Vetter
bd116e6ad9 win_print_history() print 'me' on regular chats if we wrote the message
Same behaviour like when we used to get it from the text files.
2020-04-06 15:48:23 +02:00
Michael Vetter
067bc690f2 Adapt win_print_history() to work with muc too 2020-04-06 15:33:01 +02:00
Michael Vetter
0942d98c61 Remove chat_log_get_previous()
We now dont get the log files from the text files via chat_log_get_previous() anymore.
We use the sql backend via log_database_get_previous_chat().

So far it just has the same behaviour like chat_log_get_previous(),
except that in _chatwin_history() we don't pass the sender to
win_print_history() which should be fixed in a commit soon.

And log_database_get_previous_chat() can later easily be expanded to fix
https://github.com/profanity-im/profanity/issues/205.
2020-04-06 14:42:52 +02:00
Michael Vetter
5d54bb228f Get regular chat history out of sql backend 2020-04-06 14:30:38 +02:00
Dmitry Podgorny
42b6d78a70 Fix multiple memory leaks related to rosterwin_roster()
There are multiple paths which lead to rosterwin_roster(). The function
doesn't free list returned by wins_get_private_chats().
2020-04-06 14:29:21 +03:00
Dmitry Podgorny
ba291a03f4 Fix memory leak in cons_show_disco_info() 2020-04-06 13:29:36 +03:00
Dmitry Podgorny
dc5ddb8ebe Fix memory leak in _rosterwin_resources() 2020-04-05 15:57:27 +03:00
Dmitry Podgorny
37c200571f Fixed memory leak in ProfMucWin
Profanity remembers last message and its id for the message correction
feature. We must free them in window destructor.
2020-04-03 01:47:38 +03:00
Michael Vetter
4fc938d804 Add setting to not colorize own nick according to xep-0392
Some users might want there nick to always stay white (etc) for easier
recognition.

Now we can do `/color own off` to not generate the color based on
xep-0392. The `me=` color (etc) from the theme will then be used.

Once we run this command `theme_load()` is called again.
And the theme looks totally wrong.
We encountered this at other times already and I think it's nothing
wrong with this new code here now but that there seems to be a missing
closing attr for the color when drawing.

Should be investigated seperately.

Fix https://github.com/profanity-im/profanity/issues/1288
2020-03-25 12:54:25 +01:00
Michael Vetter
f131680055 titlebar: allow displaying MUC name and MUC jid
`/titlebar use name|jid` -> `/titlebar show|hide name|jid`

Fix https://github.com/profanity-im/profanity/issues/1284
2020-03-24 22:22:16 +01:00
Michael Vetter
fd090d384d move titlebar code in correct function 2020-03-24 21:46:40 +01:00
Michael Vetter
3c56b289ed Add slashguard feature
New command `/slashguard` tries to protect against typing ` /quit` by
not allowing a slash in the first 4 characters.
2020-03-18 18:20:05 +01:00
Michael Vetter
52e7e596aa xep-0084/avatar: add option to open avatar directly
Change:
`/avatar me@somewhere.org` -> `/avatar get me@somewhere.org`

New:
`/avatar cmd feh`
`/avatar open me@somewhere.org`

Implement https://github.com/profanity-im/profanity/issues/1281
2020-03-10 07:12:13 +01:00
Michael Vetter
7e62d458ee Make statusbar tab more resilient
If users input strange stuff and we can't create a jid from it even the
setting is set to 'user' we still should fallback to the regular
identifer.

For example with `/msg @name%matrix.domain.org@matrix.org hi`.
2020-03-09 16:33:42 +01:00
Michael Vetter
a3889c94bc Rename ProfBufferEntry jid variable 2020-03-09 13:33:48 +01:00
Michael Vetter
f3d9de133e Check for sender of LMC message 2020-03-09 13:31:49 +01:00
Michael Vetter
f7fe87dd4e Write from jid in buffer
Not all cases covered yet.
2020-03-09 12:52:47 +01:00
Michael Vetter
95a16c2486 Add barejid to buffer struct 2020-03-09 12:47:43 +01:00
Michael Vetter
441e31984e Remove old comments 2020-03-09 12:31:49 +01:00
Michael Vetter
56836fb72d Use correct MUC message timestamp
win_println_incoming_muc_msg() always used the current time. Now let's
use whatever is sent int he message struct (from the delay stanza or
the current time that we set now once the message is received).

No playing with the time upon display anymore.
2020-03-09 12:22:36 +01:00
Michael Vetter
3d7e6fae7c Use ProfMessage as parameter for win_println_incoming_muc_msg() 2020-03-09 12:00:15 +01:00
Michael Vetter
0801623018 window.c: Rename variable 2020-03-09 11:51:32 +01:00
Michael Vetter
ca14f3a1a2 Fix memory leak in win_create_muc()
I suspect this was just a copy paste error.
`_win_create_simple_layout()` is called in other creation functions like
`win_create_config()` or `win_create_private()`.

I suspect when `win_create_muc()` was created it was just copied. But in
this function we actually set the layout ourself later.

So calling the function isn't needed.

Regards https://github.com/profanity-im/profanity/issues/1279
2020-02-27 16:14:54 +01:00
Michael Vetter
fc35a5a492 Stop buffer_remove_entry_by_id() once we found the entry
No need to continue to loop through the rest.
2020-02-25 16:11:59 +01:00
Michael Vetter
f597de4889 Properly free buffer entry
g_slist_delete_link() is not enough we also need to call _free_entry()
on the entry.

This fixes a memleak in win_insert_last_read_position_marker()
2020-02-25 16:06:00 +01:00
Michael Vetter
1a87d7be3e Only use enc_char in win_print_incoming() when needed
Fixes potential memory leak too.
2020-02-25 14:52:38 +01:00
Michael Vetter
99dc1c9494 Rename separator to trackbar 2020-02-21 19:17:12 +01:00
Michael Vetter
6dbbbe11e5 Make trackbar color configurable
Use `main.trackbar` in themes.
2020-02-21 19:12:16 +01:00
Michael Vetter
eb2fbdba2e Dont filter out own MUC messages if muc history is set to 'regular'
We use the same incoming function as for regular incoming text here. But
don't want to filter out our own messages since we didn't print them
during sending.

Follow up to 8ee2cdadc8
2020-02-21 18:46:09 +01:00
Michael Vetter
7fdc4ed7f6 win_print_incoming() strdup the charactar
Fix bug introduced in 1f8b1eb740.
Forgot to strdup() here.
2020-02-21 08:02:11 +01:00
Michael Vetter
1f8b1eb740 Allow utf8 symbols as omemo/pgp/otr indicator char
Fix https://github.com/profanity-im/profanity/issues/1264
2020-02-20 23:36:10 +01:00
Michael Vetter
8ee2cdadc8 Parse mentions and triggers in muc history if display is 'regular'
Fix https://github.com/profanity-im/profanity/issues/1261
2020-02-20 10:28:24 +01:00
Michael Vetter
80dd3fdbb2 Add option to color MUC history like regular messages
`/logging group color` has:
* `unanimous` which will color it with one unanimous color. Like it was
done always.
* `regular` which colors it like regular incoming messages.

Regards https://github.com/profanity-im/profanity/issues/1261
2020-02-20 08:11:58 +01:00
Michael Vetter
6aa793fca6 Refactor mucwin_history()
Just pass ProfMessage.
2020-02-19 16:57:37 +01:00
Michael Vetter
cf36a92dcb Add define names to comment 2020-02-19 16:36:54 +01:00