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

371 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
James Booth
7ad722ae28 Fix win_append buffer push 2016-10-15 22:17:16 +01:00
James Booth
bb6540f7d8 Add win highlight fuctions 2016-10-15 22:12:07 +01:00
James Booth
f3aebd547c Use varargs in win_println_indent 2016-10-15 21:05:26 +01:00
James Booth
c814cb44b8 Add win_print_history 2016-10-15 20:55:45 +01:00
James Booth
80309462ca Rename win_print_incoming_message -> win_print_incoming 2016-10-15 20:09:14 +01:00
James Booth
3b2ceee89b Add win_print_outgoing 2016-10-15 20:07:33 +01:00
James Booth
ce5f07a012 Add win_append 2016-10-15 19:53:49 +01:00
James Booth
711c5b8e45 Add win_appendln 2016-10-15 19:19:44 +01:00
James Booth
8f1d3ab55c Add win_print 2016-10-15 18:29:02 +01:00
James Booth
3612270e90 Rename win_println -> win_println_indent 2016-10-15 17:23:02 +01:00
James Booth
5488fd6e72 Remove win_vprintln_ch 2016-10-15 17:17:17 +01:00
James Booth
e29e532d87 Remove whitespace 2016-10-15 16:42:23 +01:00
James Booth
6ed04d87b3 Rename win_get_string -> win_to_string 2016-10-15 16:41:37 +01:00
James Booth
8cf9e0cccc Use win_printf_line where appropriate 2016-10-15 16:31:54 +01:00
James Booth
33b4b79f2e Add ch arg to win_printf_line 2016-10-15 00:04:57 +01:00
James Booth
2f888979c5 Use THEME_DEFAULT 2016-10-14 23:56:51 +01:00
James Booth
54cf1dbec4 Add win_printf_line 2016-10-14 23:38:39 +01:00
James Booth
24f0dc2734 Always use string format in win_printf 2016-10-12 00:40:41 +01:00
James Booth
97898ee082 Add win_printf_line 2016-10-12 00:14:55 +01:00
James Booth
7b31af3060 Remove args from win_print_with_receipt 2016-10-11 23:47:13 +01:00
James Booth
af42bc4434 Add win_print_http_upload 2016-10-11 23:40:15 +01:00
James Booth
0890179fc4 Remove win_print, use win_printf instead 2016-10-11 23:38:59 +01:00
James Booth
0337c5b22c Rename win_vprint -> win_printf 2016-10-11 23:10:48 +01:00
James Booth
d3cc5bd7ed Allow vertical positioning of all windows 2016-09-23 00:56:53 +01:00
James Booth
0aa758cbfb Add /inputwin top|bottom command
closes #853
2016-09-19 23:40:45 +01:00
James Booth
ed75f1ec71 Use SoftwareVersion in EntityCapabilities 2016-08-13 17:43:43 +01:00
James Booth
0bd5b5200a Use DiscoIdentity in EntityCapabilities 2016-08-13 17:19:24 +01:00
James Booth
80eb5bee90 Rename Capabilties -> EntityCapabilities 2016-08-13 16:39:25 +01:00
James Booth
71730e9d99 Unreference GDateTime 2016-07-25 23:09:51 +01:00
James Booth
0a57c4de78 Tidy headers 2016-07-24 15:43:51 +01:00
James Booth
90b9b48ab9 Moved roster_list.c 2016-07-24 15:08:47 +01:00
James Booth
e8fc80f5c1 Update GPL link in headers 2016-07-24 01:14:49 +01:00
James Booth
7abf506261 Free memory when plugin windows closed 2016-07-13 00:25:45 +01:00
James Booth
5f393a6d9f Remove plugin window on /close 2016-07-12 02:16:12 +01:00
James Booth
3bb1f12410 Add session.c 2016-05-05 23:51:49 +01:00
Dominik Heidler
1b0ce852bb Implement XEP-0363: HTTP File Upload 2016-04-26 23:50:55 +02:00
James Booth
9b177a9e01 Removed #AX_PREFIX_CONFIG_H 2016-03-31 21:05:02 +01:00
James Booth
355adb117c Added WIN_PLUGIN case to win_free() 2016-03-07 18:24:04 +00:00
James Booth
7fdf50eb31 Add plugin wins to /win and /close autocompletion 2016-03-01 00:03:11 +00:00
James Booth
1f90aca503 Merge branch 'master' into plugins-c
Conflicts:
	src/main.c
	src/ui/console.c
2016-02-14 23:00:52 +00:00
James Booth
e53e94f1e2 Updated copyright 2016-02-14 22:54:46 +00:00
James Booth
41fe8c22b1 Added C plugin code from plugins branch 2016-02-14 22:28:55 +00:00
James Booth
62b0cdd8fd Fix room notification reminders 2016-02-07 01:15:40 +00:00
James Booth
6702bb9739 Don't show notification reminders for messages the user does not want notifications for 2016-02-04 01:24:37 +00:00
James Booth
77e819e81a Handle self leaving room in private wins 2016-02-03 00:11:38 +00:00
James Booth
150015fa3d Show message in private windows when user offline 2016-02-02 21:52:13 +00:00
James Booth
0501e49623 Fix handling of unknown characters with word wrap 2016-01-26 00:25:13 +00:00
James Booth
0ae975c27f Added themes for roster room mention and triggers
closes #718
2016-01-25 00:19:26 +00:00
James Booth
adb470c454 WIP: Add /theme properties command 2016-01-21 00:50:55 +00:00
James Booth
850ac3c6c0 Allow unlimited theme items 2016-01-10 03:11:05 +00:00
James Booth
055a5f71ce Added roster struct, create and destroy roster on connect/disconnect 2016-01-05 00:06:50 +00:00
James Booth
d9435d3b65 Tidy wins_create_summary() 2015-11-29 23:58:52 +00:00
James Booth
d3389db233 Only show reminder notifications when notifications are enabled 2015-11-25 22:33:26 +00:00
James Booth
3bc9275079 Added word wrap to roster panel 2015-11-22 01:39:20 +00:00
James Booth
0763bfc9f4 Pass wrap boolean to win_sub_print() 2015-11-22 01:00:14 +00:00
James Booth
3d1299eb1e Renamed subwin functions 2015-11-22 00:54:40 +00:00
James Booth
7a324abcd6 Option to show presence information on single line in roster 2015-11-22 00:30:42 +00:00
James Booth
4b022687fa Added /roster indent contact 2015-11-21 21:03:53 +00:00
James Booth
d6e4b74802 Removed ui_input_nonblocking() 2015-11-01 18:56:34 +00:00
James Booth
ff9abecd50 Combined chatwin OTR SMP functions 2015-10-27 22:25:26 +00:00
James Booth
2ce43b633f Applied coding style to src/ui/ 2015-10-25 23:31:11 +00:00
Michael Vetter
4730dca546 Undefine argument list
Call va_end() to correclty stop using the argument list.
2015-10-12 09:29:04 +02:00
Michael Vetter
dd2ce7a5bf Reduce scope of variables in ui/core
Not as important as the other one (where there was a double
declaration). But for the sake of consistency.
2015-10-12 09:29:01 +02:00
James Booth
b9948a4c01 Added time format perferences per window type 2015-09-30 22:34:27 +01:00
James Booth
99fc70bd92 Added last activity time format option 2015-09-29 23:30:23 +01:00
James Booth
b4722632b6 Split PGP incoming and outgoing message handling 2015-08-30 01:32:13 +01:00
James Booth
1bf584793f Added preference for encryption char 2015-08-26 01:06:10 +01:00
James Booth
f998ab8f3b Display special char for encrypted messages 2015-08-26 00:42:56 +01:00
James Booth
0410dd90f1 Free timestamp and id for receipts 2015-08-09 23:08:36 +01:00
James Booth
783342a48c Free timestamps and carbons stanzas 2015-08-09 00:40:37 +01:00
James Booth
41c93c3350 Handle larger than line words in wrapping 2015-07-30 01:31:11 +01:00
James Booth
8ec931eb84 Added cons_show_padded 2015-07-29 23:48:28 +01:00
James Booth
79f618367d Do not print newline when curs position 0 2015-07-29 23:03:00 +01:00
James Booth
5576b88a04 Added indent padding 2015-07-29 22:48:03 +01:00
James Booth
46e2f11b93 Removed /mouse command 2015-07-19 22:48:12 +01:00
James Booth
106e909fbd Merge remote-tracking branch 'incertia/time'
Conflicts:
	src/config/preferences.c
2015-07-01 20:16:09 +01:00
James Booth
dd206ef637 WIP fix for #516, needs memory cleanup 2015-06-29 23:48:41 +01:00
James Booth
6b44b988f4 Moved refresh subwin logic to window.c 2015-06-15 18:59:20 +01:00
James Booth
989dde77cd Added win_resize() function 2015-06-15 18:08:47 +01:00
James Booth
a849b200b3 Added win_clear() function 2015-06-15 17:54:47 +01:00
James Booth
e0783e20db Renamed otr trusted window property 2015-06-13 01:13:56 +01:00
Will Song
3842daa334
fix indent code 2015-05-29 20:45:10 -05:00
Will Song
9463c67190
fix conflicts 2015-05-29 19:53:37 -05:00
James Booth
c19a05ca09 Use null check convention in window.c 2015-05-04 23:11:32 +01:00
James Booth
8ccbeade44 Added enc_mode to ProfChatWin 2015-05-04 21:38:19 +01:00
James Booth
57dc5f14ef Added option to show jids in occupants panel 2015-04-12 02:14:37 +01:00
James Booth
981618b7da Added static functions to commands.c for sending messages 2015-03-16 01:29:03 +00:00
James Booth
b21edfaa51 Added receipt.sent theme setting 2015-03-15 19:35:25 +00:00
James Booth
1014244408 Use colouring for message receipts 2015-03-14 16:05:13 +00:00
James Booth
6fd5b617ef Renamed win_save_newline -> win_newline 2015-03-14 14:16:50 +00:00
James Booth
b84bddc46b Renamed win_save_println -> win_println 2015-03-14 14:14:46 +00:00
James Booth
e02dbe24da Renamed win_save_print -> win_print 2015-03-14 14:12:32 +00:00
James Booth
f4441ec64f Renamed win_save_vprint -> win_vprint 2015-03-14 14:10:10 +00:00
James Booth
7454bede8b Merge branch 'master' into readline 2015-02-23 00:50:58 +00:00
Christian Storm
a1d14c4526 Fixed spelling. 2015-02-17 10:52:37 +01:00
James Booth
b24510c776 Merge branch 'master' into readline
Conflicts:
	src/tools/history.c
	src/tools/history.h
2015-02-11 00:09:58 +00:00
James Booth
b3be26a214 Updated copyright 2015-02-10 23:16:09 +00:00
James Booth
64774a947e Merge branch 'master' into readline 2015-02-09 22:11:25 +00:00
James Booth
1a98f1404b Free resource lists 2015-02-09 21:46:54 +00:00
James Booth
51ccb69580 Merge branch 'master' into readline
Conflicts:
	src/ui/inputwin.c
2015-02-09 21:28:08 +00:00