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
c2ec3e7033
Enable error logging on MAM RSM
2021-01-28 14:44:53 +01:00
Michael Vetter
840238b126
Get MAM from last 7 days
...
Probably should make this configurable later.
2021-01-28 14:44:53 +01:00
Michael Vetter
d3303517f7
MAM: Request more pages via RSM
...
Send another request with same jid and last id we got.
2021-01-28 14:44:53 +01:00
Michael Vetter
6e1e01dbb8
Adapt MAM RSM code to latest functions
...
Some functions changed in the meantime.
stanza_get_child_by_name_and_ns() got dropped and
xmpp_stanza_get_child_by_name_and_ns() from newer libstrophe is used.
2021-01-28 14:44:53 +01:00
Michael Vetter
db65255a5a
wip: add rsm after we get the first couple of mam messages
2021-01-28 14:44:53 +01:00
Michael Vetter
69e35e86b2
mam: Use correct ID in rsm handler
...
Thanks to DebXWoody for the help.
2021-01-28 14:44:53 +01:00
Michael Vetter
d06ca64098
mam: fix logging message
2021-01-28 14:44:53 +01:00
Michael Vetter
014e03c72e
Start working on MAM RSM to get more pages
...
Regards https://github.com/profanity-im/profanity/issues/660
2021-01-28 14:44:35 +01:00
Michael Vetter
8c08e64f37
Update copyright
2021-01-08 16:36:30 +01:00
Michael Vetter
881b99c062
Remove not needed include
2020-12-16 14:46:01 +01:00
Michael Vetter
a94378f206
Fix various typos
2020-12-10 09:24:32 +01:00
Michael Vetter
35aecd425f
Declare counter var inside loop
...
We require c99/gnu99 anyways.
2020-11-09 11:33:33 +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
DebXWoody
15f45fcfe1
Fixed Date format for MAM request
...
Using g_date_time_new_now_utc instead of g_date_time_new_now_local
Using g_date_time_format(timestamp, "%FT%TZ") instead of "%FT%T%:::z"
Edit:
DebXWoody created this patch because ejabberd returned an error with the
old date format.
2020-10-28 09:06:49 +01:00
Dmitry Podgorny
3a86b997ca
xmpp/bookmark: don't use uninitialised field
...
When a bookmark is created with '/bookmark add' command,
ext_gajim_minimize remains uninitialised in new bookmark object and
is read further in _send_bookmarks().
Initialise the field with 0.
Fixes #1432 .
2020-10-19 00:00:00 +03:00
Philipp Klaus Krause
6a276e74e3
Since the string from strerror should never be modified, use const.
2020-10-14 09:52:26 +02: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
Michael Vetter
0a9200e268
Require libstrophe/libmesode 0.10.0
2020-09-30 19:30:40 +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
d7b7f54782
ox review: Use english not german
2020-07-10 13:41:48 +02:00
DebXWoody
0552e50c78
OX: XEP-0373: OpenPGP for XMPP - Version 0.5.0 (2020-06-19)
...
Discovering Public Keys via PEP
* 4.3 Discovering Public Keys of a User
* 4.4 Requesting Public Keys
* Import Public Keys into GnuPG's local keyring.
Issue: #1331
2020-07-10 13:40:00 +02:00
Michael Vetter
a2726b6a7d
Apply coding style
2020-07-07 14:18:57 +02:00
Michael Vetter
bddbfa58c0
OX: Fix tests
...
Fix:
```
/usr/bin/ld: src/xmpp/ox.o: in function `ox_announce_public_key':
src/xmpp/ox.c:90: undefined reference to `p_ox_gpg_readkey'
```
2020-07-07 14:07:38 +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
DebXWoody
5a17957253
OX: Announce public key on PEP
...
src/pgp/gpg.c:p_ox_gpg_readkey
Used to read a public key from a file. The function will return the fingerprint
of the file and the base64 encoded key.
src/xmpp/ox.[hc]
ox_announce_public_key(const char* const filename) can be called from the /ox
announce <filename> command. The key within the file will be pushed on PEP and
the Metadata node will be set.
Issue: #1331
2020-07-06 13:19:18 +02:00
Michael Vetter
bf170d6c91
Merge branch 'omemofix'
2020-07-04 17:38:44 +02:00
DebXWoody
54667c022f
Messages are not shown in ChatSecure
...
In 0.9.x we fixed an issue, because OMEMO devices should be defined in "item"
with id "current". This should work, but it won't work if there is no "current".
If there is no "current" we will just use the first item.
Issue #1384
2020-07-04 17:38:30 +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
ad3dd72325
Add HEADLINE stanza define
2020-07-02 17:17:28 +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