Commit Graph

107 Commits

Author SHA1 Message Date
Evgeniy Khramtsov 8b2d308498 Change routing API
Now 'From' and 'To' arguments must be omitted in functions
and structures related to routing.
The commit deprecates the following functions:
     ejabberd_router:route/3 in favor of ejabberd_router:route/1
     ejabberd_router:route_error/4 in favor of ejabberd_router:route_error/2
     ejabberd_local:route_iq/4 in favor of ejabberd_local:route_iq/2
     ejabberd_local:route_iq/5 in favor of ejabberd_local:route_iq/3
The format of {route, From, To, Packet} is changed in favor of {route, Packet}
2017-02-16 11:10:24 +03:00
Evgeniy Khramtsov e564f9ae31 Make a message is not bounced if it's archived 2017-01-21 13:47:47 +03:00
Evgeniy Khramtsov 68cf45a8b9 Archive message before delivering it to offline storage (#1348) 2017-01-21 11:47:04 +03:00
Evgeniy Khramtsov 56ef607904 Add stanza-id to every archived message (#1477) 2017-01-20 23:21:06 +03:00
Evgeniy Khramtsov d5d906184f Merge branch 'new_stream'
Conflicts:
	src/cyrsasl.erl
	src/ejabberd_c2s.erl
	src/ejabberd_cluster.erl
	src/ejabberd_frontend_socket.erl
	src/ejabberd_node_groups.erl
	src/ejabberd_router.erl
	src/mod_bosh.erl
	src/mod_ip_blacklist.erl
	src/mod_muc_mnesia.erl
	src/mod_offline.erl
	src/mod_proxy65_sm.erl
2017-01-20 19:35:46 +03:00
Evgeniy Khramtsov 87b964a7f6 Make sure 'jabber:client' namespace is added to forwarded messages (#1474) 2017-01-19 18:03:07 +03:00
Evgeniy Khramtsov 0baaad30b1 Implement database backend interface for MUC, BOSH and auth_anonyous 2017-01-13 12:03:39 +03:00
Evgeniy Khramtsov 1e55e018e5 Adopt remaining code to support new hooks 2017-01-09 17:02:17 +03:00
Christophe Romain 32e5781a6a Cleanup file headers 2017-01-03 15:58:52 +01:00
Badlop 5fdd1c39fe Update copyright date automatically (#1442) 2017-01-02 21:42:06 +01:00
Evgeniy Khramtsov 0f11b1be36 Don't forget to erase cache on user removal 2016-11-24 18:40:20 +03:00
Holger Weiss 114ca786ee Let ejabberd_sm mark copied messages
When multiple resources have the same (highest) priority, ejabberd_sm
dispatches messages addressed to the bare JID (or to an unavailable
resource) to each of these resources.  Such messages are now marked with
an 'sm_copy' flag for all but one of the resources.  This makes it
easier for other modules to identify those duplicates.

Resolves #1356.
2016-11-22 19:25:20 +01:00
Evgeniy Khramtsov b8dcc911a3 Make common tests working again 2016-11-18 13:38:08 +03:00
Evgeniy Khramtsov 7e9f1a6dc1 Don't auto-decode forwarded payload 2016-11-13 13:41:04 +03:00
Evgeniy Khramtsov b8f22ff538 Deprecate most of the functions from jlib.erl 2016-11-13 10:44:53 +03:00
Evgeniy Khramtsov 78a44e0176 Merge branch 'master' into xml-ng
Conflicts:
	src/adhoc.erl
	src/cyrsasl_oauth.erl
	src/ejabberd_c2s.erl
	src/ejabberd_config.erl
	src/ejabberd_service.erl
	src/gen_mod.erl
	src/mod_admin_extra.erl
	src/mod_announce.erl
	src/mod_carboncopy.erl
	src/mod_client_state.erl
	src/mod_configure.erl
	src/mod_echo.erl
	src/mod_mam.erl
	src/mod_muc.erl
	src/mod_muc_room.erl
	src/mod_offline.erl
	src/mod_pubsub.erl
	src/mod_stats.erl
	src/node_flat_sql.erl
	src/randoms.erl
2016-11-12 13:27:15 +03:00
Holger Weiss 2a63d0e95a mod_mam: Use user JID for stanza ID 'by' attribute
Use the user (or room) JID instead of the server JID for the 'by'
attribute of <stanza-id/> and <archived/> tags.  That's what the
examples in XEP-0313 v0.2 and XEP-0359 v0.3.0 suggest.
2016-11-01 08:47:08 +01:00
Evgeniy Khramtsov 67720c7713 Add more MUC tests 2016-10-17 13:37:23 +03:00
Holger Weiss b693601dd1 Don't let MAM messages go into offline storage 2016-10-12 23:10:25 +02:00
Evgeniy Khramtsov 6a3691ef7c Add xdata generator and make some code using it 2016-10-07 10:31:03 +03:00
Evgeniy Khramtsov 58969fb854 Improve namespace handling 2016-09-24 14:17:21 +03:00
Evgeniy Khramtsov 151668ac10 Fix dialyzer warnings for mod_mam 2016-09-13 16:56:34 +03:00
Evgeniy Khramtsov e987b88848 Make common tests working again 2016-09-13 12:30:05 +03:00
Holger Weiss 20a510d877 mod_mam: Add 'store_mam_message' hook
The new 'store_mam_message' hook is invoked whenever a MAM message is
stored.
2016-08-15 23:28:36 +02:00
Holger Weiss bf9d6b5534 Honor <store/> hint for any non-"error" message
XEP-0334 says: "A message containing the <store/> hint that is not of
type 'error' SHOULD be stored by the entity."
2016-08-12 21:13:10 +02:00
Holger Weiss 28dde294e5 mod_mam: Don't store messages of type "headline"
XEP-0313 says: "a server SHOULD include in a user archive all of the
messages a user sends or receives of type 'normal' or 'chat' that
contain a <body> element."
2016-08-12 20:38:17 +02:00
Evgeniy Khramtsov 31faa4eb9a Add more type specs 2016-08-12 13:17:42 +03:00
Evgeniy Khramtsov 522a186a38 Improve some type specs 2016-08-09 10:56:32 +03:00
Evgeniy Khramtsov 4ff8d7918a Change code to reflect recent changes in fxml_gen 2016-08-05 08:41:08 +03:00
Holger Weiss 9a5f0751be mod_mam: Simplify "assume_mam_usage" option
The "assume_mam_usage" option now takes a boolean value.  Setting it to
"true" has the same effect as "if_enabled" had before.  The "on_request"
behavior is no longer offered, as it made the option (and its
documentation) overly complex.
2016-08-05 01:57:01 +02:00
Evgeniy Khramtsov 8275e95a16 Swap variables in their correct places 2016-07-27 18:06:34 +03:00
Evgeniy Khramtsov 179fcd9521 Rewrite mod_mam and mod_muc to use XML generator 2016-07-25 13:50:30 +03:00
Holger Weiss 8f8c499cfa mod_mam: Fix handling of result set page limit
Restore function clause for handling a client-specified result set page
limit that doesn't exceed mod_mam's upper threshold.
2016-07-19 21:23:30 +02:00
Holger Weiss 9fcb81dea9 mod_mam: Always limit result set page size
Limit the number of messages returned for a given MAM request even if
the client didn't specify an RSM set (not just if the client specified
an RSM set without a limit).

This is still not done for MAM v0.2 requests though, as that version of
the XEP doesn't require clients to support RSM.
2016-07-19 21:08:13 +02:00
Evgeniy Khramtsov f6e960d326 Fix compilation error 2016-07-10 08:45:24 +03:00
Evgeniy Khramtsov 786bd4f26c Use hooks instead of direct calls to mod_mam 2016-07-09 12:43:01 +03:00
Evgeniy Khramtsov 4220a2b98c Make modules loading in a dependent order (#1191) 2016-07-06 14:58:48 +03:00
Christophe Romain cd0244eb71 Merge pull request #1120 from anagromataf/feature/archive-id-in-message-carbons
Send unique stanza id and archived tag also in the message carbons
2016-06-22 15:47:27 +02:00
Christophe Romain 7744339347 Update supported xep version 2016-06-22 11:24:01 +02:00
Holger Weiss 26bce5dee3 mod_mam: Fix "assume_mam_usage: if_enabled" 2016-06-14 16:40:46 +02:00
Tobias Kräntzer 2529acc36c Send unique stanza id and archived tag also in the message carbons
- Change order of the hooks in mod_mam for sending and receiving packets. Messages are archived before a carbon copy is send to the other recourcces.
- Add archived tag and unique stanza id to the outgoing packet to have message carbons with the archive information.
- Add additional hook (in mod_mam) to strip the archive tag for outgoing packets after message carbons have been send.
2016-05-15 20:13:25 +02:00
Holger Wei 6cb60aaff5 Cosmetic change: Make variable names consistent
Use the same variable names in both mod_mam:select/8 clauses to avoid
confusion.
2016-05-03 19:12:57 +02:00
Evgeniy Khramtsov 3493a87469 Fix typo in mod_mam:select() (#1098) 2016-04-30 21:37:18 +03:00
Evgeniy Khramtsov 9c369b7a8c Improve detection of databases supported by modules (#1092) 2016-04-27 17:10:50 +03:00
Evgeniy Khramtsov 1aae8a9fda Rename odbc to sql everywhere 2016-04-20 13:25:42 +03:00
Evgeniy Khramtsov 52571e8624 Clean mod_mam.erl from DB specific code 2016-04-15 15:11:31 +03:00
Evgeniy Khramtsov fced8dc3d9 Replace some ?ERR_* macros with ?ERRT_* 2016-03-31 11:00:29 +03:00
Evgeniy Khramtsov 7a9e93839a Fix some LIMIT related problems with MSSQL 2016-03-29 11:34:00 +03:00
Holger Weiss 17be70339c mod_mam: Send new preferences when they are set
If a client updates the archiving preferences, include the new
preferences with the IQ result (as mandated by XEP-0313).
2016-02-10 23:06:31 +01:00
Evgeny Khramtsov 2bfb619d19 Merge pull request #914 from weiss/mam-expose-jid
Expose occupant JID in MUC MAM messages whenever possible
2016-02-08 14:23:19 +03:00