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

313 Commits

Author SHA1 Message Date
Michael Vetter
b67054aa39
Merge branch 'master' into xep/xep0107-user-mood 2021-12-06 13:49:04 +01:00
Michael Vetter
6c3e6a5262 xep-0107: adapting the pubsub/headline code
Like mentioned on the review at
https://github.com/profanity-im/profanity/pull/1605 I don't ge why
@DebXWoody changed the code like he did.

I changed it to something that made more sense to me now.
Instead of looking for headline in two places and checking for pubsub in
a headline place (only).

I didn't check this deeply. And still have a feeling that this is not
the best way to go. But I didn't read the XEP yet.

Added a TODO to the code regarding this too.

A quick skimming through https://xmpp.org/extensions/xep-0107.html
doesn't show me anything regarding headline. So I really don't see why
this needs to go here.

Hopefully @DebXWoody checks this in the future. But since he didn't
react on the PR I decided to make some adjustments myself so we can
merge it.
2021-12-06 13:44:04 +01:00
DebXWoody
23e886ed5e Add xep-0107: User Mood support
Implementation of XEP 0107 - User Mood
2021-12-06 13:32:54 +01:00
Michael Vetter
2f7317cc18 Fix carbons criteria
We came into the carbons checking code when we received `<private
xmlns="urn:xmpp:carbons:2"/>`. Which actually marks a message to _not_
be a carbon.

In this code we also make sure that carbons only come from us.
If not we don't call the message handler code.

So we should actually only check for `<sent xmlns='urn:xmpp:carbons:2'>`
and `<received xmlns='urn:xmpp:carbons:2'>`.

Thanks pukkamustard and Holger.

Fixes https://github.com/profanity-im/profanity/issues/1614
2021-11-25 15:33:49 +01:00
Steffen Jaeckel
ffc0b49ab1 first step to remove libmesode
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2021-10-27 22:45:44 +02:00
Michael Vetter
3a9cffe013
Merge pull request #1566 from DebXWoody/bugfixing/ox
Bugfixes for OX implementation
2021-07-01 18:26:06 +02:00
DebXWoody
d01ba72535
OX bug fix
* Help / message description
 * C-Code format
2021-07-01 18:08:40 +02:00
Michael Vetter
06482fdaef Add option to only allow messages from jids in roster
`/silence on` will throw away all messages (type: chat, normal) that
come from jids that are not in the roster.

Implement https://github.com/profanity-im/profanity/issues/955
2021-07-01 18:02:03 +02:00
DebXWoody
6173e015f5
OX bug fixing
* Don't decryption if there is no private key
 * Decryption error messages
2021-06-29 20:25:50 +02:00
DebXWoody
2a011e69ac
Bugfixes for OX implementation
* autocomplete for /ox discover
 * fixed help description
 * Implemented /ox char command
 * Validated KeyID length
2021-06-28 21:28:58 +02:00
Michael Vetter
46cd09cce4 XEP-0353: Display a notice when receiving a call
Display a notice in the console when someone tries to call us.

Implement https://github.com/profanity-im/profanity/issues/1525
2021-06-09 20:14:57 +02:00
DebXWoody
183eeca632
Message received without body error log
This is not an error, the message has no body because of
XEP-0085: Chat State Notifications.

Changed log level from error to info.
2021-06-03 19:55:13 +02:00
DebXWoody
de06cd395b
Improved OMEMO logging
The most loggings has been set to debug. Just in case of error / problem the
logging should be done with log-level ERROR or WARNING.

We will see later, which loggings should be switched to log-level INFO.

This improvement has been done to find OMEMO bugs.

See also: #1070 #1530 #1538
2021-05-28 17:45:15 +02:00
Michael Vetter
56efb1a298 message: correct type checking
Found by DebXWoody.
Led to always be true (which still made it work in most cases).
2021-05-14 16:12:38 +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
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
8df5e99981 message: make _handle_error safer 2021-03-25 16:50:10 +01:00
Michael Vetter
1f96e14ce7 message: simplify _handle_headline 2021-03-25 15:43:57 +01:00
Michael Vetter
b2a02424ed message: make _receipt_request_handler safer 2021-03-25 15:38:48 +01:00
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