1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-29 19:56:07 -04:00
Commit Graph

294 Commits

Author SHA1 Message Date
Michael Vetter
099260a4e3 message: make _handle_receipt_received safer 2021-03-25 15:37:54 +01:00
Michael Vetter
2236242407 message: make _handle_groupchat safer 2021-03-25 15:36:17 +01:00
Michael Vetter
ca9c946ddc message: simplify _handle_conference 2021-03-25 15:33:30 +01:00
Michael Vetter
2601fc5571 message: make _handle_form safer 2021-03-25 15:27:59 +01:00
Michael Vetter
b1bd1ecca8 message: make _message_handler safer 2021-03-25 15:26:16 +01:00
Michael Vetter
11382a8bf3 mesage: make _handle_ox_chat safer
And on the way fix a memleak
2021-03-25 15:20:53 +01:00
Michael Vetter
8a6d256fc1 message: make _handle_chat safer 2021-03-25 15:07:09 +01:00
Michael Vetter
ee87e5b036 message: make _handle_muc_private_message safer 2021-03-25 15:03:35 +01:00
Michael Vetter
d2dc440535 message: fix potential segfault in _receipt_request_handler 2021-03-25 11:56:38 +01:00
Michael Vetter
e396e863dd message: safeguard _handle_receipt_received
This shouldnt be necessary since we check for the receipt outside
alreayd. Let's be on the safe side though in case code gets changed
later.
2021-03-25 11:54:59 +01:00
Michael Vetter
9cfe5ec787 message: reorder _handle_groupchat 2021-03-25 11:51:42 +01:00
Michael Vetter
96b228728e message: fix possible segfault in _handle_conference 2021-03-25 11:43:42 +01:00
Michael Vetter
f21a99eaf8 message: fix possible segfault in _handle_muc_user 2021-03-25 11:38:22 +01:00
Michael Vetter
e656bdb83c message: fix possible segfault in _message_handler 2021-03-25 11:34:14 +01:00
Michael Vetter
5cec47c86a Add support to approve MUC voice requests
A form will open. One can then use `/field4 on` `/form submit`.

Implements https://github.com/profanity-im/profanity/issues/1507
2021-03-17 16:16:59 +01:00
Thorben Günther
ec6f9df486
MUC: Add voice request
closes https://github.com/profanity-im/profanity/issues/1211
2021-03-12 14:57:00 +01:00
Michael Vetter
69e923df3b Remove forgotten debug line 2021-02-15 09:58:37 +01:00
Michael Vetter
1435c7ae14 Use correct time for MAM messages
We need the delay value from the <forward> element.

Regards https://github.com/profanity-im/profanity/issues/660
2021-02-04 21:13:31 +01:00
Michael Vetter
8c08e64f37 Update copyright 2021-01-08 16:36:30 +01:00
Michael Vetter
3b3c9bf4d5 Print all error stanzas
Regards https://github.com/profanity-im/profanity/issues/1435

So far we didn't print the error if it contained `<error
type="cancel">`. It appears that the code always thought this is a
service-not-available (so one is either blocked or the account doesn't
exist) and printed `Recipient not found`.

But there can be other errors as well. Like in above mentioned issue
`not-allowed`.

Let's just print the text.

In case of the cancel type we still remove the jid from the chat
sessions. I'm not entirely sure whether this needs to be done in other
cases too.
2020-10-30 15:09:40 +01:00
Michael Vetter
4d4c094b5f Enable _handle_ox_chat() payload/body decryption
This part of the code was waiting for xmpp_stanza_new_from_string() from
libstrophe 0.10.0.
2020-10-09 09:38:47 +02:00
Michael Vetter
17b1b431f5 Replace stanza_get_child_by_name_and_ns with xmpp_stanza_get_child_by_name_and_ns
Replace our own stanza_get_child_by_name_and_ns() with the upstreamed
xmpp_stanza_get_child_by_name_and_ns() provided by the new
libstrophe/libmesode 0.10.0.
2020-09-30 19:41:08 +02:00
Dmitry Podgorny
7553676b40 Fix memory leak in _handle_chat()
jid_create() for attribute "to" was called twice and the 1st object was
lost.
2020-08-07 00:47:45 +03:00
Michael Vetter
8852db03d6 Parse stanza-id
Add stable stanza IDs to ProfMessage struct.

We parse this for 1:1 messages (MUC needs to be done too).

<stanza-id> for live messages
<result id="x"> for MAM messages

Regards MAM: https://github.com/profanity-im/profanity/issues/660
Regards Stable IDs: https://github.com/profanity-im/profanity/issues/1207
2020-07-23 14:21:27 +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
aecbeff8ba message.c: Use message->to_jid instead of to_jid
This one will always be set.
2020-07-03 18:04:07 +02:00
Michael Vetter
b1343cd3ac message.c: _handle_carbons() check from field outside of function
So that we don't have to pass the wrapping stanza and can handle
the error nicer.
2020-07-03 17:55:15 +02:00
Michael Vetter
896e6c4e87 message.c: Dont duplicate code in _handle_carbon and _handle_chat
Trying to simplify the conditions so we don't have duplicate code
in both of those functions.
2020-07-03 17:51:42 +02:00
Michael Vetter
8ce299838d message.c: Remove from/to setting out of condition
Since its done in both cases.
2020-07-03 16:38:05 +02:00
Michael Vetter
0412ec9662 message.c: Small code improvements 2020-07-03 16:26:33 +02:00
Michael Vetter
c66d3c6389 message.c: Put XEP-0085 code in helper function 2020-07-03 16:17:18 +02:00
Michael Vetter
14f33e54f6 Change formatting 2020-07-03 12:35:48 +02:00
Michael Vetter
8d8ef675cd handle_headline(): Free text correctly 2020-07-03 12:05:46 +02:00
Stefan Kropp
3640900cf6 Handle headline stanza
Authored by DebXWoody in:
https://github.com/profanity-im/profanity/pull/1369

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

Since I'm in the process of cleaning up message.c I take this now
so he doesn't have to rebase.

I also omitted the _handle_normal() case since I'm not sure that would
be correct.

Probably will be addressed again when continuing the cleanup.
2020-07-03 12:02:41 +02:00
William Wennerström
d5aae08c41
Fix messages with receipt request not displayed
Messages from Conversations contains:
  <request xmlns='urn:xmpp:receipts'/>

And would not be displayed in Profanity as it never reached
_handle_chat(..).
2020-07-02 20:50:26 +02:00
Michael Vetter
83ed9ba24b message.c: Put plugin handler code in helper function 2020-07-02 17:53:28 +02:00
Michael Vetter
6be5b51a46 message.c: Log invalid message type
So far we logged when we receive a message without a type. Which is
actually quite common and makes no sense.
2020-07-02 17:47:07 +02:00
Michael Vetter
46a00317ee message.c: Check for message type
RFC 6121 allows only few types.
So we can also remove that check in _handle_chat().
2020-07-02 17:40:58 +02:00
Michael Vetter
19d9e80a79 message.c: Remove handled cases form _handle_chat()
Both cases are tested before entering that function.
2020-07-02 17:32:14 +02:00
Michael Vetter
d9cfa2e48a message.c: Break out of _message_handler() after handling code
AFAIK it can only be one.
Except at STANZA_NS_MUC_USER which is used in several cases.
2020-07-02 17:31:56 +02:00
Michael Vetter
b14b711492 message.c: Parse incoming message stanzas according to type 2020-07-02 17:15:42 +02:00
Michael Vetter
728cb55b68 message.c: Add pubsub helper function 2020-07-02 16:48:57 +02:00
Michael Vetter
f2b415079a message.c: Add XEP information 2020-07-02 16:37:20 +02:00
Michael Vetter
1f50647865 message.c: Add my copyright 2020-07-02 15:22:58 +02:00
Michael Vetter
3350139ed0 message.c: Make several functions static 2020-07-02 15:21:54 +02:00
Michael Vetter
10190b5fb0 message.c: Adjust function formatting 2020-07-02 15:20:17 +02:00
Michael Vetter
8de6a7bfb0 And ifdefs around new OX functions
Fix for some build cases introduced in 2c94ee5a88
Fix https://github.com/profanity-im/profanity/issues/1376
2020-06-30 11:10:27 +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