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
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
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