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

271 Commits

Author SHA1 Message Date
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
Michael Vetter
3066fd77fc Save MUC room name in ProfMucWin
We will need this if we want to display the Name instead of the JID.
2020-01-23 11:35:33 +01:00
Michael Vetter
e2b44a69bd separator: Print only one for each chat window
So far we printed one after the last received message, which doesn't
make much sense of course.
Now only print one if there is not already one present.
2019-12-13 12:47:27 +01:00
Michael Vetter
a1ed37953c separator: print trackbar across the whole line
Use the whole line.
We do this in win_redraw() so upon terminal size change it still
matches.

Regards https://github.com/profanity-im/profanity/issues/1238
2019-12-13 12:19:07 +01:00
Michael Vetter
14f25992c3 Initial work on last-read-position feature
Print dashes on the position we last left off in a chat window.
So far the number of dashes is hardcoded, and the feature only works in
chat windows.

Regards https://github.com/profanity-im/profanity/issues/1238
2019-12-13 12:05:24 +01:00
Michael Vetter
2750194279 Implement Color Vision Deficiencies setting
Implement settings for redgreen and blue blindness.

Regards https://github.com/profanity-im/profanity/issues/1191
2019-12-12 11:07:11 +01:00
Aurelien Aptel
7a0a578a8a XEP-0392: theme, ui: conditionally colorize user nicks
* add theme_hash_attrs()
* when printing a user message check PREF_COLOR_NICK to decide whether
  to colorize it or not

ideally we should hash the jid instead of the nick but this is already
a first step.
2019-12-03 21:10:39 +01:00
Michael Vetter
09b8802f51 _win_print: Guard against time being null
This is encountered when biboumi is used.
Example: `/join #debian-next%irc.oftc.net@biboumi.lebihan.pl`
It seems then time can be null.

g_date_time_format() will not work in this case although time_pref will
not be "off". So let's not call g_date_time_format() in this case. But
treat it like time is set to off.

However message reflection will not work properly with biboumi.
Probably we dont get origin-id.

Fix https://github.com/profanity-im/profanity/issues/1230
2019-12-01 18:01:28 +01:00
Michael Vetter
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
bc282ef569 Move id from DeliveryReceipt to ProfBuffEntry struct
XEP-0184: Message Delivery Receipts, *requires* the id attribute.
Generally this is not the case.
For this reason the id was only present in the DeliveryReceipt struct
since it was only used for XEP-0184.

For https://github.com/profanity-im/profanity/issues/660 XEP-0313 MAM
and https://github.com/profanity-im/profanity/issues/805 XEP-0308 Last Message Correction
we will also need the id.

So in preparation for further work let's move the id to the general
ProfBuffEntry.

We will need to adapt code so that we actually always write the ID if we
receive one.
2019-11-01 17:53:59 +01:00
Michael Vetter
4ecd4dea6a Replace sent_messages list with algo
For OMEMO we had a list with our sent messages.
It was used so that we don't decrypt our own messages in MUCs that come
in via reflection.

Recently for https://github.com/profanity-im/profanity/pull/1209 we
started to use origin-id and use an algorithm so we can detect our own
sent messages via checking origin-id.

Profanity uses the same id for the message ID and origin-id.

With 06f300a42c we added the
message_is_sent_by_us() function.

We implemented XEP-0359 this way to fix
https://github.com/profanity-im/profanity/issues/1201 so that we don't
log our own messages in MUCs twice.

We can now check whether the message was sent by us using this function
and can get rid of the list.

Probably we could also put many parts of the sv_ev_room_message()
function inside (else) part of `if (!(g_strcmp0(mynick,
message->jid->resourcepart) == 0 && message_is_sent_by_us(message))) {`.

Have to look more closely whether any of this needs to be run in case
the message actually comes from us.
2019-10-31 12:56:48 +01:00
Michael Vetter
d7c00360ea
Merge pull request #874 from spiridoncha/master
Change /clear behaviour. Closes issue #855.
2019-10-05 15:12:44 +02:00
Michael Vetter
aa0f497975 Allow colorization of history messages
History was always printed with `THEME_DEFAULT` we now use
`THEME_TEXT_HISTORY` which is accesible in theme files via
`main.text.history`.

Fix https://github.com/profanity-im/profanity/issues/1170
2019-09-10 11:22:30 +02:00
Michael Vetter
e540ccd50e Remove dead assignments 2019-07-22 14:27:14 +02:00
Paul Fariello
f831f65737 Rename prof_message_t into ProfMessage 2019-06-20 14:30:45 +02:00
Paul Fariello
9482ce6168 Set foreground color for untrusted messages 2019-06-20 14:30:45 +02:00
Paul Fariello
44d16e9141 Add prof_message_t to wrap all message attributes
Probably missing copy of body to plain in carbon and privmessage.
Only covers the incoming message path because goal is OMEMO decryption
of untrusted message.
Cover some of the log functions but not all.
2019-06-20 14:30:42 +02:00
Paul Fariello
3bb3cc625d Use flags in xmmp/message.c for encryption and trust 2019-06-20 14:30:37 +02:00
Paul Fariello
e69f947547 Rework MUC reflected message filtering
Reflected messages can't be filtered by nick only otherwise you might
ignore messages comming from you on another devices.

Consequently we maintain a list of sent messages id in mucwin.
To be sure the id will be correctly reflected we use the origin-id
stanza.
2019-04-10 17:23:46 +02:00
Paul Fariello
4e1ffa6bdb Log and print outgoing encrypted message 2019-04-10 17:12:31 +02:00
Paul Fariello
0fb27dc496 Add OMEMO message encryption and decryption 2019-04-10 16:03:50 +02:00
Paul Fariello
2602cbf785 Move OMEMO initialization to profanity intialization
Also store identity keys into account
2019-04-10 15:37:22 +02:00
Michael Vetter
706af9a900 Update copyright to include 2019 2019-01-22 11:31:45 +01:00
Paul Fariello
db1ffae3bd Fix command exec error output 2018-09-05 14:17:26 +02:00
Paul Fariello
233e076be9 Add support for command config execution 2018-09-05 13:52:19 +02:00
Paul Fariello
b11d3a79df Add conf win callback 2018-09-05 13:51:00 +02:00
Paul Fariello
a952776b89 Rename mucconf wins into conf wins
Configuration windows are now being used by both muc and cmd.
2018-09-05 13:51:00 +02:00
Paul Fariello
40eee1caab Add command exec error handling 2018-09-05 13:51:00 +02:00
Paul Fariello
925cd488c1 Handle simple execution
Tested with ping from biboumi
2018-09-05 13:50:59 +02:00
Paul Fariello
c9f6a78f57 Add command subcommands: list and exec
Also handle list result
2018-09-05 13:49:40 +02:00
James Booth
59382984c0 Add preferences for tab display 2018-03-09 21:15:27 +00:00
James Booth
720dce866e Add prefs for empty tabs and tab names 2018-03-08 22:27:49 +00:00
James Booth
119c5650cf Show name in statusbar tabs WIP 2018-03-08 20:01:36 +00:00
James Booth
250e972b7a Update copyright 2018-01-21 15:00:02 +00:00
James Booth
68a3daedb9 Update Copyright 2017-01-28 17:24:22 +00:00
James Booth
9cfd17821c Allow room display properies to be set by plugins 2017-01-20 23:26:14 +00:00
James Booth
c8874cd2e0 Allow chat prefix char to be set by plugins 2017-01-20 21:03:55 +00:00
James Booth
1b25aa84cb Add titlebar encryption text to plugins api 2017-01-19 22:33:29 +00:00
James Booth
b64646979e Remove unused function 2016-11-24 00:09:14 +00:00
Spiridonov Alexander
fd2346ccb4
Makes /clear behavior configurable. 2016-11-07 03:26:15 +03:00
Spiridonov Alexander
0d6aef68e7 Change /clear behaviour. Closes issue #855. 2016-10-22 00:08:55 +03:00
James Booth
651541d7ec Rename buffer functions 2016-10-16 19:40:43 +01:00