~samwhited/xmpp

404b735d — genofire 6 days ago main
mux: ignore namespace when matching stanzas

Previously we checked that stanzas were actually stanzas (they had the
namespace jabber:client or jabber:server), however, this check is not
technically correct because there is also the component namespace.
For now, remove the check and treat all elements named "message", "iq",
or "presence" as stanzas. In the future we should improve this to allow
the negotiator to set the stanza namespace on the session and only check
for the specific correct namespace which would be more correct than this
solution or the previous way.

Signed-off-by: genofire <geno+dev@fireorbit.de>
b72aac0b — genofire 2 days ago
all: add genofire to contributors

Signed-off-by: genofire <geno+dev@fireorbit.de>
b3be6ffc — genofire 2 days ago
muc: use new items package in integration tests

Signed-off-by: genofire <geno+dev@fireorbit.de>
design: add entity caps proposal

See #171 (https://mellium.im/issue/171)

Signed-off-by: Sam Whited <sam@samwhited.com>
all: implement disco identities and forms

Previously our service discovery implementation could only respond with
features. However, service discovery also supports "identities" and has
an extension mechanism that lets it respond with arbitrary data in the
form (pun intended) of a form result.

Adding implementations of these iterators to the mux and using them in
the disco handler brings us fully up to date on service discovery
features and should allow us to also implement entity capabilities in
the near future.

Signed-off-by: Sam Whited <sam@samwhited.com>
form: add Iter interface

The form.Iter interface will be implemented by handlers that need to
advertise disco info extensions.

Signed-off-by: Sam Whited <sam@samwhited.com>
disco: move identity into info package

Moving the identity into the info package will let us implement the
identity iterator in the same way it is currenlty done for the features
iter without having import loops in packages that are imported by disco.

Also fix a bug where identities were marshaled wrong that hadn't been
noticed before due to a lack of use/testing.

Signed-off-by: Sam Whited <sam@samwhited.com>
disco: allow multiple forms in info responses

Signed-off-by: Sam Whited <sam@samwhited.com>
form: add Len and Raw methods

Signed-off-by: Sam Whited <sam@samwhited.com>
design: add title to MAM proposal

Signed-off-by: Sam Whited <sam@samwhited.com>
form: provide access to fixed fields with no var

The data forms spec says that fixed fields do not have to have a
variable name since they can't be set anyways.
However, we currently rely on the variable name to get the value of
fields when iterating over all fields in a form.
This patch adds the raw, wire-format, untyped value of each field to its
data when iterating so that it can be used for fixed fields that cannot
be referenced otherwise, and for debugging.

Signed-off-by: Sam Whited <sam@samwhited.com>
mux: support responding to disco#items requests

Signed-off-by: Sam Whited <sam@samwhited.com>
disco/items: add iterator interface for items

This adds the items.Iter interface which will be implemented by any
handlers that want to serve disco items.

Signed-off-by: Sam Whited <sam@samwhited.com>
disco: move Item to new items package.

Previously we had planned to move Item into the info package so that
iterators for items and the like could live alongside iterators for
info. However, Items require using JID which would result in yet another
import loop. At the risk of creating tiny package syndrome, we've
instead opted to create an items package as well since the JID package
will likely never use the items side of service discovery.

Signed-off-by: Sam Whited <sam@samwhited.com>
docs: update funding to point to org profile

Previously the funding links pointed to one of my personal profiles,
however, it should point to the Mellium org profile so that all funds
get put back into the co-op.

Signed-off-by: Sam Whited <sam@samwhited.com>
history: support paging before and after

Previously there was no way to support the "before" and "after" queries
that are a part of Result Set Management.
This was because they are more or less redundant with after-id and
before-id as far as I can tell.

However, since it turns out that not much supports mam:2#extended (and
thus before-id and after-id queries) that the older before/after filters
can be used alongside start/end time based queries to effectively
emulate before-id and after-id.

Though it still feels like they're more or less the same thing and I
don't fully understand the difference, this adds support fore
before/after queries.

Signed-off-by: Sam Whited <sam@samwhited.com>
history: add support for tracked queries

Previously the history package contained minimal functionality for
sending queries and receiving responses asynchronously.
This patch adds support for tracking queries and iterating over their
results in the Go style of writing async code that, for all intents and
purposes, appears synchronous.

Like IQ tracking, this is accomplished by adding Fetch methods to the
handler that are similar to the Fetch functions except that they store
their results on the handler itself.
When a message is incoming the ID is checked and if it is a part of a
tracked query it is sent over a channel to the iterator, otherwise it is
handled like any other untracked messages.
If an iterator is closed it unregisters itself and any subsequent
messages that are received are handled just like any other untracked
message.

Signed-off-by: Sam Whited <sam@samwhited.com>
paging: ensure index is an attribute

Signed-off-by: Sam Whited <sam@samwhited.com>
history: support unmarshaling queries

Previously, queries could only be marshaled, which wasn't much use.
This patch adds unmarshaling and tests for both marshaling and
unmarshaling.

Signed-off-by: Sam Whited <sam@samwhited.com>
history: add initial implementation of MAM

Signed-off-by: Sam Whited <sam@samwhited.com>
Next