Add code necessary to support publishing options as described in
XEP-0060, #7.1.5. A node plugin that expects publishing options must
add <<"publish-options">> to the features/0 list and then handle the
publishing options handed over to the publish_item/7 call.
Signed-off-by: Christian Ulrich <christian@rechenwerk.net>
Holger Weiss [Mon, 23 May 2016 22:25:52 +0000 (00:25 +0200)]
mod_mam_mnesia: Don't exceed table size limit
Don't write MAM messages into an Mnesia archive if the size of the table
comes close to the 2 GB limit for tables with disc-only copies. That
way, the table is at least not corrupted when the limit is reached.
Holger Weiss [Mon, 23 May 2016 22:08:23 +0000 (00:08 +0200)]
mod_mam_mnesia: Use transactions when writing
Let mod_mam_mnesia use transactions when storing or deleting messages.
If old messages of a user are to be removed, delete the user's archive
and rewrite it from scratch, as that seems to be much faster than
removing individual records with delete_object/1.
Holger Weiss [Thu, 19 May 2016 23:28:16 +0000 (01:28 +0200)]
mod_muc_room: Notify on affiliation changes
Notify the current room occupants if the affiliation of a non-occupant
is changed as per example 195 of XEP-0045. In anonymous rooms, only
moderators are notified, though.
Holger Weiss [Tue, 17 May 2016 20:12:04 +0000 (22:12 +0200)]
mod_client_state: Add "queue_pep" option
If the new "queue_pep" option is enabled and the client is inactive, PEP
notifications are throttled in a similar way to presence stanzas and
chat states. Only the most recent notification of a given node and
payload type will be queued from a given contact.
Holger Weiss [Tue, 17 May 2016 17:27:18 +0000 (19:27 +0200)]
Move CSI queue handling into mod_client_state
Let mod_client_state handle the queueing of stanzas, not just their
classification. This simplifies the ejabberd_c2s code and gives
(custom) CSI modules more flexibility.
Holger Weiss [Sun, 8 May 2016 13:36:51 +0000 (15:36 +0200)]
Let client retry HTTP upload on file size mismatch
Let the main mod_http_upload process look at the size of an HTTP upload
rather than performing this check in the ejabberd_http handler. This
way, the upload slot won't be invalidated if the size of the uploaded
file doesn't match the size requested for the slot. The PUT request is
still rejected, but the client now has a chance to retry the upload.
Holger Weiss [Fri, 6 May 2016 14:37:17 +0000 (16:37 +0200)]
Avoid error bounces when testing stream management
The test suite sends messages to the server JID while checking whether
the stream management code counts outgoing stanzas correctly. We now
set type='headline' for those messages to avoid error bounces.
Holger Weiss [Fri, 6 May 2016 12:12:22 +0000 (14:12 +0200)]
XEP-0198: Use different error message for bounces
When stanzas are bounced from the stream management queue (because the
session timed out or was closed for some other reason), use a different
error message so that this situation can be distinguished from other
cases.
We no longer rely on getting unique values from clock source, so we need
to handle cope with systems which does not have a microsecond resolution
on system clock (such as MS Windows)
As per XEP-0016 and XEP-0191, return a service-unavailable error when an
incoming last activity query was blocked by a privacy list (just as we
do for other IQ requests).
If an incoming message sent to an unavailable resource has an unknown
type, handle it like messages of type "normal" (as mandated by RFC 6121,
section 5.2.2). The same is already done for messages of unknown type
sent to the bare JID of an offline user.
Don't bounce an error when a message of type "headline" is sent to an
unavailable resource. This is consistent with how headline messages
sent to the bare JID of an offline user are dropped, and it avoids a
presence leak.
Return error when blocking message to offline user
As per XEP-0016 and XEP-0191, return a service-unavailable error when an
incoming message sent to an offline user was blocked by a privacy list.
The same is done for a message sent to an online user, so this avoids a
presence leak.