1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00
Commit Graph

185 Commits

Author SHA1 Message Date
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
a7ecda7773
Merge pull request #1501 from xenrox/change-password
Add command to change password of logged in user
2021-03-11 18:18:03 +01:00
Thorben Günther
b0aea2bcff
Add command to change password of logged in user 2021-03-11 17:42:53 +01:00
Maximilian Wuttke
e217ed0b79 Update to the newest version of XEP 0363 (HTTP Upload)
Main changes:

1. Attributes instead of tags
2. Read the optional <header> tags and send them in the HTTP PUT header:

   * Authorization
   * Cookie
   * Expires

Co-authored-by: Martin Dosch <martin@mdosch.de>
2021-03-11 17:11:22 +01:00
Maximilian Wuttke
4124856100 Variadic version of stanza_attach_publish_options 2021-03-09 17:47:37 +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
35aecd425f Declare counter var inside loop
We require c99/gnu99 anyways.
2020-11-09 11:33:33 +01: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
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
9e460973fa Fix potential memleak in stanza_create_caps_from_query_element()
Each of those should only occur one time. But let's make sure we only
write/alloc one time to be on the safe side.
2020-04-20 15:31:48 +02:00
Michael Vetter
fe9b520c42 First MAM test
Send a request (which we can't handle yet) :-)

Regards https://github.com/profanity-im/profanity/issues/660
2020-04-11 16:05:14 +02:00
Dmitry Podgorny
44377c6a5c Fix use-after-free in stanza_create_caps_from_query_element()
The function creates a form to find such strings as software, os, etc.
It remembers the strings allocated by form_create() and use them below
in caps_create(). The issue is that the form is destroyed before and as
result the strings are freed too.

As solution, allocate own copy of strings.
2020-04-09 15:22:11 +03:00
Dmitry Podgorny
ded48a7e40 Fix memory leak in stanza_attach_correction()
xmpp_stanza_add_child() takes own reference to the child stanza.
Therefore we have to release our reference or the child is lost
and not freed otherwise.
2020-04-05 15:58:28 +03:00
Michael Vetter
62730367d6 Fix memleak in stanza_get_oldest_delay
We need to unref the temp datetimes again.
2020-02-25 15:54:44 +01:00
Michael Vetter
1118110071 xep-0308: Implement /correct to correct the last send message
So far the correction is sent. But the UI in Profanity itself is not
updated.

Also autocompletion for `/correct` with the last sent message is
missing.
2020-02-10 16:17:01 +01:00
Michael Vetter
ce48525e99 avatar: use unique id for stanza id
"retrieve1" should have been only for testing.
2020-02-07 21:12:59 +01:00
Michael Vetter
8fba8a8958 fix: Initialize variable in stanza_get_oldest_delay() 2020-01-30 12:35:49 +01:00
Michael Vetter
f80b2889ec Fix error in stanza_get_oldest_delay()
Introduced in bf2e09feee.
2020-01-30 11:54:03 +01:00
Michael Vetter
8a9488245b muc: save oldest timestamp
So far we saved the timestamp which also had the `from`.
But we need this only to find out whether it's MUC history.

For displaying we should use the oldest delay timestamp.

Also in
61f66966dd (diff-4926fd4577a336bd3eb240f8104a5c5bL837)
a error was introduced.

Before we saved the timestamp in all cases. And only if timestamp AND
from was given we went into MUC history case.
Normal timestamp saving was not done anymore only if it also had a from
attribute.

Regards https://github.com/profanity-im/profanity/issues/1254
2020-01-30 11:46:19 +01:00
Michael Vetter
bf2e09feee stanza: Refactor stanza_get_delay_from()
Have two helper functions one for XEP-0203 and one for XEP-0091.
2020-01-30 11:13:19 +01:00
Michael Vetter
3c0647ec70 Fix typo in comment 2020-01-23 23:57:18 +01:00
Michael Vetter
c2aa585615 xep-0084: Download avatars
Proof of concept.
Needs error checking, a nice interface, general cleanup..
2019-12-18 12:50:09 +01:00
Michael Vetter
548b64f6c5 Fix stanza_get_child_by_name_and_from() strcmp
Fix https://github.com/profanity-im/profanity/issues/1227
2019-11-14 19:22:06 +01:00
Michael Vetter
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
61f66966dd Check for correct delay tag for muc timestamps
https://github.com/profanity-im/profanity/issues/1190 had another issue:
Sometimes servers send multiple </delay> and we just checked the first
one we got and only used it if the 'from' attribute was fitting.
However it could be that we actually wanted the second </delay> element
and there the 'from' would have been right.

So we need to loop through them until we get the one with the fitting
'from'.

Fix https://github.com/profanity-im/profanity/issues/1190
2019-11-13 09:41:19 +01:00
Michael Vetter
196e029b47 Fix stanza_get_child_by_name_and_ns() if no name
Fix bug introduced in 68af0aad65.
2019-11-12 16:18:28 +01:00
Michael Vetter
68af0aad65 _handle_groupchat(): get correct origin-id stanza
The problem is that in _handle_groupchat() we look for
STANZA_NS_STABLE_ID which will result in origin-id or stanza-id.
It seems like prosody servers send origin-id first, so this worked in
all my tests. But actually we cannot be sure of the order.
So far we stopped after the first element was found.

I only found xmpp_stanza_get_child_by_ns() and
xmpp_stanza_get_child_by_name() in libstrophe. But we need a combination
of both.

So I created stanza_get_child_by_name_and_ns() for Profanity. I need to
remember to upstream this to libstrophe later (if they really don't have
such a function).

Fix https://github.com/profanity-im/profanity/issues/1223
2019-11-08 15:05:49 +01:00
Michael Vetter
53640f6e97 Remove prefix from stanza id
We sent `prof_prefix_uuid` as id. Where the prefix was also optional.
We don't need this at all.
2019-10-17 15:40:40 +02:00
Holger Weiß
3228ab47d3 Don't render (all) delayed messages as MUC history
Double-check that a <delay/> tag on a groupchat message was actually
added by the MUC service (rather than the sending client) before
assuming it was received from the MUC history.

Fixes #1173.
2019-08-20 17:51:26 +02:00
Paul Fariello
b110da9a92 Fix various OMEMO memleaks 2019-07-10 17:32:23 +02:00
Michael Vetter
a28f0d9e74 Update tests with new URL
https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:46:41 +02:00
Michael Vetter
ebbacec667 Update profanity URL in entity capabilities stanza
Regards https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:36:26 +02:00
Paul Fariello
e69f947547 Rework MUC reflected message filtering
Reflected messages can't be filtered by nick only otherwise you might
ignore messages comming from you on another devices.

Consequently we maintain a list of sent messages id in mucwin.
To be sure the id will be correctly reflected we use the origin-id
stanza.
2019-04-10 17:23:46 +02:00
Paul Fariello
562302846a Handle bundle publication error on publish-options
We try to reconfigure node and publish again.
If it fails again then we give up.
2019-04-10 17:23:45 +02:00
Paul Fariello
91ee289c77 Add support for disconnect in OMEMO 2019-04-10 17:12:31 +02:00
Paul Fariello
d8f0bcef94 Add publish option to OMEMO device list and bundle 2019-04-10 17:12:31 +02:00
Paul Fariello
36ce21fc6d Add store hints for OMEMO encrypted messages
Store hints are required has some server might discard messages without
body. Here we ensure OMEMO messages are stored on server and delivered
to client when they connect back.

It's really important since it avoid libsignal to desynchronize
counters.
2019-04-10 17:12:31 +02:00
Paul Fariello
9b8c1d7d2c Add support for encrypted carbon
Fix {signed,}_pre_key store
2019-04-10 16:31:45 +02:00
Paul Fariello
f9216fddb1 Add signal store backend and OMEMO start command 2019-04-10 16:03:50 +02:00
Paul Fariello
1f9d46037c Request for device list when OMEMO is ready 2019-04-10 16:03:50 +02:00
Paul Fariello
756fefb09a Fix devicelist subscription and handle pubsub event
Devicelist subscription can be done directly with caps_add feature.
2019-04-10 16:03:50 +02:00
Paul Fariello
fdc5f25f2d Add devicelist and bundle publication 2019-04-10 16:03:50 +02:00
Paul Fariello
bce1981128 Add devicelist subscription 2019-04-10 15:37:22 +02:00
Michael Vetter
706af9a900 Update copyright to include 2019 2019-01-22 11:31:45 +01:00
Paul Fariello
ac2d1c07fa Fix optionnal sessionid in xep 0050 2019-01-21 15:02:54 +01:00
Michael Vetter
47f90d7a39
Merge pull request #991 from paulfariello/feature/xep-0050
Add support for xep 0050 ad-hoc commands, without multi-step
2018-09-27 17:27:37 +02:00
Michael Vetter
82f8083b85 Move p_sha1_hash() to stanza.c
Move `p_sha1_hash()` from `common.c` to	`xmpp/stanza.c` as it is only
used in this file and now depends on libstrophe so xmpp is a better
namespace folder.
Renaming it as `_stanza_create_sha1_hash()`. And making static since
only used here.

The function cannot be tested in the unit tests anymore.
Once functional tests are working again we should write a test for the
sha1 functionality.
2018-09-06 20:40:09 +02:00