1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-10-27 20:30:13 -04:00
Commit Graph

6698 Commits

Author SHA1 Message Date
Michael Vetter
c9df520b5c sponsors: Add Matteo Bini 2021-05-12 16:50:45 +02:00
Michael Vetter
2c61e67e82
Merge pull request #1534 from profanity-im/feat/1531-directmessage
Use direct messages instead of MUC-PMs for non-anonymous MUCs
2021-05-12 16:35:04 +02:00
Michael Vetter
34e261ced5 Print message about new direct message
So users don't get surprised if they don't know the barejid of the nick.
2021-05-12 13:38:40 +02:00
Michael Vetter
722d07adf6 Use direct messages instead of MUC-PMs for non-anon MUCs
In https://github.com/profanity-im/profanity/issues/1070 we have:
`OMEMO encryption for MUC PM (OMEMO MUCs are not anonymous, so we should
start a regular 1:1 in this case instead of MUC PM. A discussion started
to make this a general feature #1531)`

In https://github.com/profanity-im/profanity/issues/1531 we have the
general issue to start regular 1:1 messages instead of MUC PMs if the
room is non-anonymous.

This is like suggested in https://docs.modernxmpp.org/client/groupchat/.
2021-05-12 13:31:20 +02:00
Michael Vetter
5906c4ade1
Merge pull request #1532 from profanity-im/feat/1516-intype
Have separate settings for intype (console/titlebar)
2021-05-11 12:16:09 +02:00
Michael Vetter
64244474d3 Have intype on by default 2021-05-08 19:41:38 +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
Michael Vetter
1ef700f918 Reduce scope of dir variable 2021-05-06 17:58:00 +02:00
Michael Vetter
929faae926 command: Simplify return in autocompletion 2021-05-06 17:55:38 +02:00
Dustin Lagoy
2b56e33d16 Fix prof_get_name_from_roster documentation 2021-04-29 14:03:17 -04:00
Dustin Lagoy
2350a94c44 Add plugin get_barejid_from_roster function 2021-04-29 13:50:57 -04:00
Dustin Lagoy
802442fffc Change nick to name in api to match convention
Change all instances of *get_nick_from_roster to *get_name_from_roster
to match the convention of names in the roster itself.
2021-04-28 09:32:20 -04:00
Dustin Lagoy
ed4d2fcfb2 Add plugin prof_get_nick_from_roster function 2021-04-28 09:17:02 -04:00
Michael Vetter
4a94c051a4
Merge pull request #1528 from dustinlagoy/pre-chat-message-display-on-history
Apply pre_chat_message_display hook to history
2021-04-28 09:28:41 +02:00
Dustin Lagoy
9d404971da Apply pre_chat_message_display hook to history 2021-04-27 20:42:30 -04:00
Michael Vetter
c106187db7 command: Fix serversoftware examples 2021-04-18 16:08:50 +02:00
Michael Vetter
8e588d6764 Fix random string generation
Our variable `alphabet` contains 62 alphanumeric symbols + '\0'.
When we use sizeof(alphabet) we will get 63 due to that.
But we want to choose a random numbers from the 62 alphanumeric letters only.

This mistake caused us to have strings with a max length of `length`
instead of the exact length.

When doing https://github.com/profanity-im/profanity/issues/1520
this caused our algo for muc reflection to not catch since we expect the
random ID to be exactly 15 symbols long in `message_is_sent_by_us()`.
2021-04-17 22:37:21 +02:00
Stefan
3ba38eafa8
OMEMO - trust mode (#1506)
Add OMEMO trust mode capabilities.

* ToFu / first usage
* blind trust
* manual
2021-04-17 13:28:54 +02:00
Michael Vetter
c79979401b sponsors: mention new sponsor James Pond 2021-04-16 23:25:21 +02:00
Michael Vetter
d566f3cae1 readme: remove extra mention regarding ml
Already mentioned in SPONSORS.md.
2021-04-16 23:22:42 +02:00
Michael Vetter
19c5925c37 editor: make editor configurable via /executable
`/executable set editor /full/path/to/edit`.

Regards https://github.com/profanity-im/profanity/issues/1521
2021-04-16 23:18:19 +02:00
Michael Vetter
1f4f912e78 editor: adapt help description 2021-04-16 23:04:13 +02:00
Michael Vetter
db2205d30c editor: Save temp files as .md
Probably many people render text in their head to markdown
automatically.
2021-04-16 22:18:01 +02:00
Michael Vetter
2f4289bb3e
Merge pull request #1485 from StefanKropp/feature/editor-command
Add basic functionality to launch external editor

Regards https://github.com/profanity-im/profanity/issues/1521
2021-04-16 19:27:07 +02:00
Michael Vetter
e1249d9bbb Editor: improve error messages 2021-04-16 19:14:40 +02:00
Michael Vetter
8be46422d2 editor: Use g_strdup_printf() instead of g_string_new() 2021-04-16 18:06:30 +02:00
Michael Vetter
880ce20018 Run clang-format on new editor code 2021-04-16 18:04:03 +02:00
Stefan
f5e1f9fa63 Editor: Fix redisplay 2021-04-16 18:04:03 +02:00
Stefan
ce508a826a Editor: Use _exit() instead of exit() 2021-04-16 18:04:03 +02:00
Stefan
9f32b2afb2 Editor: Using preferences compose.editor
compose.editor is the path to the executable ( default /usr/bin/vim )
2021-04-16 18:04:03 +02:00
Stefan
35b0b0f194 Editor command: filename / sensible-editor
* Generating a unique file name in tmp_dir folder
 * Changed exec of vim to exec of sensible-editor
 * Test file exists and create file with "private" rights
 * Send a preview of the message in the window
 * Delete temp file
2021-04-16 18:04:03 +02:00
Stefan
8be8f75b87 Add new editor command
Goal is to launch an external editor (eg vim) to edit the text there.
2021-04-16 18:03:58 +02:00
Michael Vetter
791b13cb9a Mention clipboard in version output 2021-04-16 13:17:04 +02:00
Michael Vetter
8c50b63e56 Goodbye beautiful IDs
It was a great ride!

IDs look instead of
`TE5BTDc2ZTc3YTMwZGU3MDgzMzllOTliNGExNjVmMjZkMTY1ZmUyZGEyNTUxMjVmODBkMmQzOGMxYWI2ZjAxNzdiM2Q=`
more like `7HcnNSoO1MVvb0p9a9e293152922853e910b8b1a65bb26e225a0568` now.

Regards https://github.com/profanity-im/profanity/issues/1520

We still has our identifier into it to filter MUC reflected messages.

profident maybe should be changed to be longer or be generated upon each
start.
2021-04-14 22:47:58 +02:00
Michael Vetter
558d672733
Merge pull request #1515 from mwuttke97/fix_omemo_empty_devlist
[OMEMO] Fix sending messages
2021-04-08 10:20:42 +02:00
Maximilian Wuttke
025c2fb1e0 Msg sending: don't write to chatwin nor to log if sending failed
Currently, only `chat_log_omemo_msg_out` can fail (i.e. return `NULL`
instead of a stanza id). In this case, the message is neither printed to
the chat window nor added to the log (since it wasn't sent).
2021-04-08 00:30:03 +02:00
Maximilian Wuttke
e8664e2730 OMEMO: Fail if message keys couldn't be encrypted for any recipient device
If the message (key) can't be encrypted for any device, sending the
message is refused and an informative error message is presented to the
user.

Also, don't encrypt for the same device, since the OMEMO XEP disallows
this.
2021-04-08 00:29:58 +02: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
3c1e4bac3a Fix segfault in cmd_autoaway()
Two mistakes were here:
* `/autoaway time away` without a time argument segfaulted
* `/autoaway message away` without a mesage set to (null). We have
  `/autoaway message off to set it off.

Also use g_strcmp0() instead of strcmp().
2021-03-29 10:48:42 +02:00
Michael Vetter
a09d49d884
Merge pull request #1514 from profanity-im/fix/1512-rpi
Include config.h in omemo files
2021-03-26 20:07:18 +01: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
Michael Vetter
eaf76555bd Include config.h in omemo files
So that off_t is defined in all files (so far http_upload.c and
http_download.c too) the same way.

Fix https://github.com/profanity-im/profanity/issues/1512

Thanks @pasis for finding the solution!
2021-03-26 19:54:04 +01:00
Michael Vetter
acda845b2a iq: use define for 'cancel' 2021-03-26 10:05:24 +01:00
Michael Vetter
3884a4d35b message: parse stanzaid in MUC case
There was a todo for this in message.c which got forgotten.

This was most likely also the reason why there were NULL entries for
this in the DB which DebXWoody mentioned in the MUC.

Thus comparison was with NULL and no new entries were added to the
database.

Edit:
After checking pull requests I see Stefans draft PR:
https://github.com/profanity-im/profanity/pull/1505

So let's add him as co-author.

Co-authored-by: Stefan Kropp <stefan@debxwoody.de>
2021-03-25 17:09:52 +01:00
Michael Vetter
c72351375d
Merge pull request #1513 from profanity-im/fix-possible-segfault1
Fix potential problems caused by unexpected stanzas
2021-03-25 17:04:22 +01:00
Michael Vetter
a1a37cf9bf ox: fix memleak in ox_announce_public_key 2021-03-25 17:02:59 +01:00
Michael Vetter
8df5e99981 message: make _handle_error safer 2021-03-25 16:50:10 +01:00
Michael Vetter
3a6bce5a09 event: make log_database_get_previous_chat safer 2021-03-25 16:47:35 +01:00
Michael Vetter
901f9d3d8c database: make log_database_get_previous_chat safer 2021-03-25 16:46:18 +01:00