~singpolyma/cheogram

Merge branch 'component-avatar'

* component-avatar:
  Show avatar in vCard for component also
  Notify of the component's avatar along with presence
  Respond with avatar contents when asked
Show avatar in vCard for component also
Notify of the component's avatar along with presence

Whenever we tell a JID that we are online, also tell them "hey, this is my
avatar BTW".  If they care they can fetch it from us.
Respond with avatar contents when asked

If an avatar is specified in the config file, grab the needed metadata.  We
assume the avatar is image/png since the spec mostly requires at least that
codec to be present.  If we receive a pubsub request for exactly the node and
item that is this avatar, we return the base64 encoded content.
Update CI constraints
Merge branch 'fix-errors-in-adhoc'

* fix-errors-in-adhoc:
  IQManager should get both IQResult and IQError
  Never reply to an error
IQManager should get both IQResult and IQError

Since they are both types of replies. Without this every error is just a
timeout, and also the IQMANAGER-targetted error will slide through to other code
and do crazy things.
Never reply to an error

This can cause an error loop, especially if the other side does the same.
Merge branch 'cv_forward_jingle'

* cv_forward_jingle:
  Support Backend Default Sip Proxies
  Support Jingle Message Outbound
  Double Slashes
  Forward Unhandled Calls to sip.cheogram.com
  Add Resource to Presence Queries
  Allow Removing Sip Proxy
  Add Audio to Caps if SIP Proxy is Present
Support Backend Default Sip Proxies

Using XEP-0215 for a slightly unconventional purpose, we built code that
requests a sip service from the user's configured backend.

So that means the user can have its own sip server setup in Cheogram,
but if they don't then we can request it from the backend.
That means outbound calling will be set for anyone using a supported
backend, without us having to get all of them to run this command.

And if neither they nor their backend have sip configured, then there
just won't be a call button!
Support Jingle Message Outbound

Movim requires Jingle Message to call, so we just receive messages, send back
"yeah go ahead" and then send directed presence.
Double Slashes

We were including a slash in the sip resource, but putting a slash when we
combined them. This meant there were two slashes in practice, which was bad
Forward Unhandled Calls to sip.cheogram.com

This is based on the corresponding new changes to the Jingle library.
We will now be handed stanzas we don't know about, and we'll forward
those on to sip.cheogram.com.

This also involved a change to the stanzas we receive *from*
sip.cheogram.com, since we need to respond to jingle messages from the
same resource they were sent to.

But we also need to be able to handle incoming calls to no resource in
particular.

So we're using two different resources now, so we can store the
upstream sip information in the resource on an inbound call, and we can
store the downstream resource information on an outbound call.
Both of which allow us to connect the dots.
Add Resource to Presence Queries

We had another case where Conversations expected a resource and hard-crashed
without one.

So when I hit the new "phone call" button we just enabled, it died.
Putting this in does technically change things for users, but likely not in a
way any of them would actually notice, and it makes Conversations die less.
So fine.
Allow Removing Sip Proxy

Our broken little test command can now unset as well.
This has allowed us to test that the call button both appears and disappears!
Add Audio to Caps if SIP Proxy is Present

This should allow outgoing calls to contacts when a user has set
themselves up to make calls.

Along the way we adjusted the way disco is handed to the backend.
Previously it would be sent with a special resource, and then that
resource would be handled inbound so we know what kind of response we've
just received.

That allowed us to be stateless, but now that we have stateful things we
want the ask the backend, it's much more useful to be able to send a
query to the backend and handle the response, if there is one, while we
still have the original request in scope.

This same technique could be used for other flows we have, but doing so
is outside the scope of this commit.
Allow x@x.tld forms in whispers
Allow sms-side commands to use proxied JIDs

Since we know about ourselves, we can know to strip our own proxies JIDs back to
the real thing. This is useful if something wants to talk to us from SMS side
but only knows about our proxied JIDs and doesn't know we exist.
Spawn thread per inbound stanza

Especially now that some stanzas can trigger real inline work (for cacheHTTP),
either all such works needs to be made async, or we can just make stanza
handling async itself.  There's no reason not to do this, and I intended to do
it several times before, and it just never made it in before now.

As a benefit here, we log all exceptions produced by the sub-thread and do not
re-throw them, since nothing that happens handling a single stanza should crash
the whole process.  This increases our exception resiliance quite a bit.
Preserve file extesion through cacheOOB

Some users have MIME-blind tooling that really likes file extensions like the
olden days.  Doesn't hurt us to support that in some cases.  So, if the original
URL had an extension (something at the end ofter a . 4 chars or less) we append
it to the new URL.  Make sure your server is set up to rewrite these away!
Merge branch 'componentStanzaRecord'

* componentStanzaRecord:
  Use Record for componentStanza context
Next