Commit Graph

4960 Commits

Author SHA1 Message Date
Evgeniy Khramtsov 3a5d2dbed8 Move mod_irc to ejabberd-contrib 2018-06-20 12:27:44 +03:00
Holger Weiss 23cc0f8c3c mod_push: Include a static body text by default
Set the 'include_body' option to a static text by default.  Some app
servers check for the presence of a 'last-message-body' field to
distinguish between notifications generated for actual chat messages and
notifications triggered by other types of traffic.
2018-06-19 23:12:27 +02:00
Holger Weiss 81f4dd0e6a mod_push_keepalive: Increase default timeout
Set the default session timeout to three days.  This way, sessions will
survive a weekend without traffic, for example.
2018-06-19 22:26:08 +02:00
Paweł Chmielowski dee3081df1 Fix reset_stream in websocket using pre-rfc protocol 2018-06-19 17:51:09 +02:00
Evgeniy Khramtsov 6acac7c93f Render roomname, allowinvites and allowpm in room disco#info 2018-06-19 14:02:45 +03:00
Holger Weiss c2f664f941 mod_push_mnesia: Simplify record matching
Omit record fields that aren't used for matching.
2018-06-18 23:12:27 +02:00
Holger Weiss 75127a0deb mod_push_mnesia: Fix lookup of all host sessions 2018-06-18 23:05:08 +02:00
Holger Weiss bb76da03ea mod_mam: Don't replace existing stanza ID
Preserve the original stanza ID for resent messages.  This avoids
storing duplicates in the MAM archive.
2018-06-16 00:43:22 +02:00
Paweł Chmielowski 3099702039 New shaper implementation 2018-06-15 11:56:46 +02:00
Badlop 3ec623f329 Make connected_users_info and user_sessions_info DB-agnostic (#2448)
The result returned by connected_users_info command has changed,
and is now similar to the result of user_sessions_info.

Notice that num_active_users and process_rosteritems still require Mnesia.
2018-06-15 11:28:57 +02:00
Evgeniy Khramtsov 6c323b729b Improve type spec 2018-06-14 19:51:50 +03:00
Evgeniy Khramtsov 17b05ff4b7 Get rid of all calls to jlib.erl module 2018-06-14 19:49:27 +03:00
Evgeniy Khramtsov 7b04a625be Get rid of jlib.hrl/jlib.erl 2018-06-14 19:11:43 +03:00
Evgeniy Khramtsov 49b08949b1 Do not check for deprecated types
Since we support only Erlang >= OTP-17.5, the check for old-style
dict/queue/etc types is no longer needed
2018-06-14 18:58:35 +03:00
Evgeniy Khramtsov fd8e07af47 Get rid of ejabberd.hrl header
The header consisted of too many unrelated stuff and macros misuse.
Some stuff is moved into scram.hrl and type_compat.hrl.
All macros have been replaced with the corresponding function calls.

TODO: probably type_compat.hrl is not even needed anymore since
we support only Erlang >= OTP 17.5
2018-06-14 14:00:47 +03:00
Evgeniy Khramtsov c3c75affa9 Log modules startup 2018-06-14 10:18:10 +03:00
Holger Weiss 85f09b365f mod_push: Omit summary for outgoing messages
Don't include a urn:xmpp:push:summary form in push notifications that
are triggered by outgoing messages.  App servers might use the form
fields to generate user-visible notifications directly (as opposed to
just waking the client app).  This is usually not desired for outgoing
messages.
2018-06-13 21:43:40 +02:00
Evgeniy Khramtsov 645f11d79d Advertise disco#info and disco#items features in mod_disco
Fixes #2470
2018-06-13 14:55:06 +03:00
Holger Weiss 0a20e45690 mod_push: Further improve handling of carbons
Also check for carbon-copied messages (with a body) in the queue of
unacknowledged stanzas.
2018-06-13 00:25:14 +02:00
Holger Weiss 0a9f522222 mod_push: Also include sender/body for carbons
If the 'include_sender' and/or 'include_body' options are specified,
also include a urn:xmpp:push:summary form in push notifications that are
generated for carbon-copied messages (with a body).
2018-06-12 22:47:23 +02:00
Evgeniy Khramtsov 6f481e3ceb Avoid lager crash on external authentication failure
Fixes #2463
2018-06-08 09:51:26 +03:00
Paweł Chmielowski 40185b6bd3 Add ability to modify version string 2018-06-07 15:38:33 +02:00
Holger Weiss a4049d9418 Omit 'xmlns' field from 'feature_csi' record
The 'xmpp' library has been updated to omit the 'xmlns' field from the
'feature_csi' record.
2018-06-04 23:05:11 +02:00
Holger Weiss ba30ac8ce8 Return detailed error if HTTP upload is too large
If the file size specified in an HTTP upload slot request exceeds the
the configured maximum size, include the limit with the stanza error.
2018-06-04 22:18:56 +02:00
Evgeniy Khramtsov 43c3134f55 Also format gracefully errors returned during module reload 2018-06-03 18:53:30 +03:00
Paweł Chmielowski 67fc2015de Fix problem in commit 548ef7b835 2018-06-01 18:36:39 +02:00
Paweł Chmielowski 548ef7b835 Don't crash in bosh when we receive request with RID < prev_rid 2018-06-01 16:12:22 +02:00
Evgeniy Khramtsov 4337300fce Always display room's xdata in disco#info 2018-06-01 09:07:16 +03:00
Evgeniy Khramtsov cab8005bf3 Display muc#roomconfig_changesubject in room's disco#info
Fixes #2449
2018-06-01 08:56:56 +03:00
Evgeniy Khramtsov 4fc8d1c4a4 Send trailer and close socket explicitly on stream end 2018-06-01 07:58:03 +03:00
Evgeniy Khramtsov 1261502f6a Improve indentation 2018-05-30 22:53:34 +03:00
Holger Weiss dacba3ec00 Merge remote-tracking branch 'processone/pr/2446'
* processone/pr/2446:
  Fix authentication for usernames containing uppercase characters
2018-05-30 20:53:11 +02:00
Stu Tomlinson 4f8af723c6 Fix authentication for usernames containing uppercase characters
Applies to authentication methods that compare User (normalized)
and AuthzId (was not being normalized). These are external, ldap & pam.

Fixes #2280
2018-05-30 18:43:26 +01:00
Evgeniy Khramtsov 5e446d50a8 Get rid of direct calls to 'session' Mnesia table
Fixes #2439
2018-05-30 19:21:56 +03:00
Evgeniy Khramtsov 0f9db50c8d Support for roomconfig_lang/roominfo_lang
Now room owners are able to set a preferred language
for the discussions in the room, so other users can
discover rooms based on the language they wish to talk.

TODO: the language format should conform to RFC 5646.
      This check should be implemented in 'xmpp' library.

Fixes #2436
2018-05-30 08:11:58 +03:00
Evgeniy Khramtsov 52b8226671 Use 'list-multi' type for XEP-0157 xdata fields
Thanks to Jonas Wielicki for spotting this
2018-05-29 19:37:24 +03:00
Evgeniy Khramtsov 0381ce1e75 Better report errors of module startup 2018-05-28 09:19:49 +03:00
Evgeniy Khramtsov fc77051b68 Don't call Mod:function() in xmpp_stream callbacks
If a callback function is not defined by the `Mod` then
a call to code_server process is performed. Under heavy load
this may cause code_server to get overloaded. We now avoid this.
2018-05-26 09:06:24 +03:00
Holger Weiss bfe2545c01 mod_muc_sql: Fix export to SQL
The "host" column is supposed to hold the MUC host name.
2018-05-24 01:28:29 +02:00
Holger Weiss c6a9c30f1c mod_push_mnesia: Apply cosmetic changes
Improve the readability of the 'max_user_sessions' check.
2018-05-23 21:40:54 +02:00
Holger Weiss 508f3ef88d mod_push_sql: Check 'max_user_sessions' limit
Remove the oldest push session(s) of a user if the number of enabled
sessions exceeds the 'max_user_sessions' limit.
2018-05-23 20:02:52 +02:00
Paweł Chmielowski 97f7d99007 Handle "Expect: 100-continue" request header in ejabberd_http 2018-05-23 14:52:47 +02:00
Rogério da Silva Yokomizo 4a4cc32650 Export ext_mod:add_sources/1 2018-05-22 16:16:13 +02:00
Evgeniy Khramtsov d2114be6f3 Correctly calculate remaining bytes on file upload 2018-05-19 18:29:33 +03:00
Christophe Romain db51d522e8 Add support for REST API custom headers
ext_api_headers can be defined as a single string. Headers are separated
by comma. Definition MUST NOT contain spaces. Example
"X-MyHead:test,X-Token:082748"
2018-05-17 14:47:21 +02:00
Evgeniy Khramtsov b64e1d95d2 Fix typo file:read() -> file:open() 2018-05-17 12:00:06 +03:00
Paweł Chmielowski c41bab9ca0 Clean state between requests in ejabberd_http 2018-05-15 14:25:19 +02:00
Evgeniy Khramtsov 063737e4f5 Optimize HTTP requests memory usage
Due to historical reasons, ejabberd loads the whole file/data
into the memory when serving an HTTP request. This is now improved:

1) For GET requests ejabberd uses sendfile(2) if the underlying
   connection is HTTP and falls back to read/write loop with 64kb
   buffer for HTTPS connections. This type of requests are handled
   by mod_http_fileserver, mod_http_upload, ejabberd_captcha, etc
2) POST requests are now limited to 20Mb and are fully downloaded
   into the memory for further processing (by ejabberd_web_admin,
   mod_bosh, etc)
3) PUT requests (e.g. for mod_http_upload) are handled by read/write
   loop with 64kb buffer
2018-05-14 19:39:58 +03:00
Badlop cb3bb710bd Handle muc_register_nick success correctly (#2415) 2018-05-14 12:24:56 +02:00
Evgeniy Khramtsov c30715e67b Disable thumbnails creation by default 2018-05-11 18:56:31 +03:00