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

312 Commits

Author SHA1 Message Date
Michael Vetter
e5ac12afa6 Remove prefs_free_string()
It just does a free.
Related to b580b9ef11
2020-07-02 11:34:12 +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
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
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
86af6925d9 Simplify win_refresh_with_subwin() 2020-04-20 16:09:40 +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
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
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
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
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
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
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
cf36a92dcb Add define names to comment 2020-02-19 16:36:54 +01:00
Michael Vetter
ea5a947f52 Refactor win_print_history()
We never use the printf like behaviour anyways.
2020-02-17 12:05:58 +01:00
Michael Vetter
6e68f1812b Refactor win_print_outgoing_muc_msg()
We never use the printf like behaviour anyways.
2020-02-17 12:03:23 +01:00
Michael Vetter
f13ea11f95 Refactor win_println_incoming_muc_msg()
We never use the printf like behaviour anyways.
2020-02-17 11:58:36 +01:00
Michael Vetter
69d474b3a7 Refactor win_print_outgoing()
We never use the printf like behaviour anyways.
2020-02-17 11:48:50 +01:00
Michael Vetter
fcfb493dfb Rename buffer->from to buffer->display_from 2020-02-14 10:17:07 +01:00
Michael Vetter
9b3593bdf9 xep-0308: enable correction in outgoing messages with delivery receipts 2020-02-14 10:17:07 +01:00
Michael Vetter
3e901aee99 Rename win_print_with_receipt() -> win_print_outgoing_with_receipt() 2020-02-14 10:17:07 +01:00
Michael Vetter
2900bf4aef Rename win_println_them_message() -> win_println_incoming_muc_msg()
In aa3693daa211b36c78d136d5a1ee9f3258e21352 I renamed
`win_println_me_message()` -> `win_print_outgoing_muc_msg()`.

Now: `win_println_them_message()` -> `win_println_incoming_muc_msg()`
to be more consistent and descriptive.
2020-02-14 10:17:07 +01:00
Michael Vetter
743ec6afd0 xep-0308: only replace messages if the user enabled the feature
Outgoing `/correct` will still work.
2020-02-14 10:17:07 +01:00
Michael Vetter
4ec005e4c3 xep-0308: Implement LMC for outgoing MUC messages
Including OMEMO encrypted ones.
Also rename `win_println_me_message()` to `win_print_outgoing_muc_msg()
as I think it's a more descriptive name.
2020-02-14 10:17:07 +01:00
Michael Vetter
7cd1be36f2 xep-0308: Display corrected incoming MUC messages correctly 2020-02-12 12:56:34 +01:00
Michael Vetter
38c32be14c Distinguish between _win_print() and _win_printf()
_win_print() and _win_printf() sound like they are the same. But
actually they are something totally different.

I renamed _win_print() to _win_print_internal() for that reason. It's
more about actually drawing to the ncurses window.

_win_printf() calls _win_print() and also writes the text to the window
buffer. Which _win_print() didn't, it was really just the ncurses
specific things.

In some cases there is _win_print_internal() called after a
buffer_append() in those cases it might be more correct to actually call
_win_printf().
It was not done so far. But probably is better. But will mean a bit more
operations.

I'll have to check this later.
2020-02-12 08:32:34 +01:00
Michael Vetter
0482a80f8a Rename win_correct_incoming to win_correct
and make it static.
2020-02-12 07:07:54 +01:00
Michael Vetter
b6b7dd5ad4 xep-0308: update the UI upon sending a corrected message
So far we don't do this for encrypted messages. Still needs to be done.
And MUC also needs to be done.
2020-02-11 15:26:58 +01:00
Michael Vetter
1118110071 xep-0308: Implement /correct to correct the last send message
So far the correction is sent. But the UI in Profanity itself is not
updated.

Also autocompletion for `/correct` with the last sent message is
missing.
2020-02-10 16:17:01 +01:00
Michael Vetter
dd8086772d xep-0308: create setting to toggle lmc
and print settings if only `/correction` is run.
2020-02-10 14:52:42 +01:00
Michael Vetter
f16d56a15e xep-0308: Initial support for incoming LMC 2020-02-10 13:19:54 +01:00
Michael Vetter
772224421d Clear buffer upon /clear
I think both the window and the buffer should also be cleared in case
`/clear` is issue and persist_history is off.

Otherwise it could happen that win_redraw() redraws the whole content of
the buffer again.
2020-02-07 15:52:24 +01:00
Michael Vetter
31509022ef NULL room_name in win_create_muc() 2020-01-23 18:22:36 +01:00