24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-02 21:17:12 +02:00
Commit Graph

5361 Commits

Author SHA1 Message Date
Paweł Chmielowski
aaf674160b Sort messages by stanza_id when using mam storage in mod_offline 2019-04-29 16:32:19 +02:00
Paweł Chmielowski
faf9b20ac0 Return correct value from count_offline_messages with mam storage option 2019-04-29 16:31:37 +02:00
Paweł Chmielowski
17ff62d4af Make mod_offline put msg ignored by mam in spool when mam storage is on 2019-04-29 16:30:45 +02:00
Paweł Chmielowski
b716b835c4 Add tests for offline use_mam_for_storage 2019-04-29 11:35:18 +02:00
Paweł Chmielowski
b76f90fe39 Add mod_offline option for fetching data from mam instead of from spool table
This commit introduces `use_mam_for_storage` option that take boolean
argument. Enabling it will make mod_offline not use spool table for storing
offline message, but instead will use mam archive to retrieve messages
stored when offline.

Enabling this option have couple drawback currently, only messages that
were stored in mam will be available, most of flexible message retrieval
queries don't work (those that allow retrieval/deletion of messages by id).
2019-04-26 19:59:06 +02:00
Paweł Chmielowski
bcfe50f817 Return "Bad request" error when origin in websocket connection doesn't match
This also allow websocket_origin option to accept multiple values instead
of just single one.
2019-04-26 15:29:43 +02:00
Paweł Chmielowski
17444ba84e Allow non-moderator subscribers to get list of room subscribers 2019-04-25 14:52:47 +02:00
Evgeny Khramtsov
a0c8c70c9c Use binary framing in MQTT WebSockets 2019-04-25 14:30:42 +03:00
Paweł Dorofiejczyk
cc5829bc33 Fix RFC6454 violation on websocket connection when validating Origin header 2019-04-24 16:59:54 +02:00
Paweł Chmielowski
8b501f5fe6 Catch potential exceptions in gen_mod:wait_for_process
Seems that at ejabberd shutdown, process may terminate before that function
is called, and in that case erlang:monitor throws exception.
2019-04-24 13:46:16 +02:00
Evgeny Khramtsov
fc043dd8cf Reformat try_set_password/4 function 2019-04-23 21:25:10 +03:00
Evgeny Khramtsov
cbf3fec2c8 Don't call to mod_register when it's not loaded
Fixes #2828
2019-04-23 21:05:21 +03:00
Evgeny Khramtsov
edba1aebb5 Add WebSockets support to mod_mqtt
Example configuration:

listen:
  ...
  -
    port: 5280
    module: ejabberd_http
    request_handlers:
      "/mqtt": mod_mqtt

modules:
  ...
  mod_mqtt: {}
2019-04-23 19:18:22 +03:00
Paweł Chmielowski
d2ea905926 Fix handling of list arguments on pgsql 2019-04-23 17:46:42 +02:00
Evgeny Khramtsov
feb4c7f5e9 Support other socket modules for MQTT 2019-04-23 16:22:27 +03:00
Evgeny Khramtsov
5faae61bef Move websocket options 2019-04-23 16:21:06 +03:00
Evgeny Khramtsov
cc892ddc01 Improve request_handlers validator 2019-04-23 16:19:26 +03:00
Evgeny Khramtsov
7c45b52c86 Correctly support cache tags in ejabberd_auth 2019-04-19 15:42:24 +03:00
Evgeny Khramtsov
0789a145fc Allow returning HTTP headers in REST responses 2019-04-19 15:16:47 +03:00
Evgeny Khramtsov
7f14826564 Use new ets_cache api in ejabberd_auth 2019-04-19 15:08:41 +03:00
Paweł Chmielowski
875b2daff1 Add hook room_destroyed called when room gets destroyed 2019-04-17 18:56:25 +02:00
Paweł Chmielowski
4e2c95fe58 Change implementation of misc:unique_timestamp() 2019-04-16 11:20:55 +02:00
Paweł Chmielowski
83653c0338 Handle cdata in initial data probe of ws module 2019-04-16 10:56:11 +02:00
Paweł Chmielowski
3706e35b86 Make misc:unique_timestamp not overflow microsecond part.
This should fix issue #2860
2019-04-16 10:24:28 +02:00
Paweł Chmielowski
c96a925fde Add hooks for tracking mucsub subscriptions changes 2019-04-15 12:03:30 +02:00
Evgeny Khramtsov
009b9a1fd0 Feed whole image to eimp:identify/1
Fixes #2859
2019-04-14 17:05:16 +03:00
Paweł Chmielowski
8761e6e0e0 Handle correctly case where ExtraUsername is empty 2019-04-11 12:00:13 +02:00
Paweł Chmielowski
c5a06e9d06 When making mucsub message from mam archive check for subject 2019-04-09 11:17:14 +02:00
Evgeny Khramtsov
2e007f1607 Use xml:lang from stanza when it's missing in <command/> element
Thanks to Philipp Hörist for spotting this
2019-04-06 18:27:28 +03:00
Evgeny Khramtsov
9f3ccd604e Add 'sessionid' attribute when required
Fixes #2852
2019-04-06 16:52:22 +03:00
Evgeny Khramtsov
909a505d65 Update mod_muc_riak 2019-04-03 16:04:58 +03:00
Evgeny Khramtsov
3013f1b9bc Update mod_mam dependencies 2019-04-03 15:01:20 +03:00
Evgeny Khramtsov
17b9dc6035 Decrease ugliness of the ugly code 2019-04-03 14:50:56 +03:00
Evgeny Khramtsov
e66f594901 Change mucsub API for database backends 2019-04-03 14:20:37 +03:00
Badlop
4e591a73c5 Add ext_mod paths before checking config (processone/ejabberd-contrib#263) 2019-04-03 13:10:11 +02:00
Paweł Chmielowski
623a9ec3ba Return proper error message for duplicate or missing args in http_api call 2019-04-03 12:05:39 +02:00
Paweł Chmielowski
65a6532cd9 Log message when trying to execute http_api command with extra arguments 2019-04-03 11:50:15 +02:00
Paweł Chmielowski
33c10867e3 Formating fix 2019-04-03 11:48:59 +02:00
Paweł Chmielowski
d085fff14b Make http_api command execution exception catcher log also command and args 2019-04-03 11:33:07 +02:00
Badlop
cbac8a604a cache_size not applied to mod_roster on reload_config (#2769) 2019-04-02 19:52:07 +02:00
Evgeny Khramtsov
d96ab48c6b Fix previous commit
Fixes #2847
2019-04-02 09:58:12 +03:00
Evgeny Khramtsov
ed2abe471a Rename listening callback from start/2 to start/3
This will prevent conflicts in callback names in mod_mqtt
Old callback function is still supported.
2019-04-01 16:53:28 +03:00
Paweł Chmielowski
7eef966a04 Fix issue with creating HostMatch in mod_mam_sql
This fixes issue #2844
2019-04-01 10:56:03 +02:00
Evgeny Khramtsov
5c69122bbe Use xmpp:get_subtags/2 2019-04-01 10:47:29 +03:00
Paweł Chmielowski
9b040f65a3 Don't use deprecated gen_mod:db_type 2019-03-29 18:41:51 +01:00
Paweł Chmielowski
24b9b69783 Fix issue with mam tests
Too much copy/paste...
2019-03-29 17:18:30 +01:00
Paweł Chmielowski
0c78e01088 Implement mod_muc_sql:select_with_mucsub
This allows us to limit number of issued queries required by
user_mucsub_from_muc_archive option
2019-03-29 16:11:50 +01:00
Paweł Chmielowski
a7310ffea1 Make misc:add_delay_info properly handle multiple delay tags in element 2019-03-29 11:25:35 +01:00
Paweł Chmielowski
8e05fd1d24 Add option user_mucsub_from_muc_archive to mod_muc
This option disable storing separate mucsub message for each individual
subscriber but instead when user fetches archive virtual mucsub messages
are generated from muc archives.
2019-03-28 17:42:25 +01:00
Paweł Chmielowski
063869603a Include id in mucsub notification message 2019-03-28 14:43:28 +01:00
Badlop
ee2b441b0f Add 'config' tag to the reload_config command 2019-03-27 11:51:43 +01:00
Badlop
1f2b8adc28 Fix Register command to respect mod_register's Access option (#2837) 2019-03-22 15:02:51 +01:00
Badlop
6545d55473 Fix crash in mod_muc_admin:web_page_main/2 caused by just_created (#2830) 2019-03-18 17:11:00 +01:00
Paweł Dorofiejczyk
6129720838 Origin header validation on websocket connection (#2821) 2019-03-15 12:19:14 +01:00
Christophe Romain
4a920dca5a Add newline to error_logger log format 2019-03-15 11:51:48 +01:00
Paweł Chmielowski
5077d39600 Add check for ljid when setting up subscribers 2019-03-14 15:54:51 +01:00
Paweł Chmielowski
3b16afeda7 Flip default bounce_groupchat flag value, muc will drop bounces anyway 2019-03-14 15:40:34 +01:00
Paweł Chmielowski
89db022da4 Add option to mod_offline to make it not bounce mucsub/groupchat messages 2019-03-14 15:17:25 +01:00
Evgeny Khramtsov
0715e62a41 Use jid() instead of ljid() 2019-03-14 14:34:15 +03:00
Evgeny Khramtsov
7a622c3392 Improve formatting of hook crashes 2019-03-14 12:28:37 +03:00
Badlop
629e568294 Delete the ping timer only when timeout_action=kill (#2820) 2019-03-13 11:28:31 +01:00
Holger Weiss
333b010d54 mod_muc: Simplify room creation checks 2019-03-12 00:05:59 +01:00
Holger Weiss
1af2b2cfc7 Merge remote-tracking branch 'processone/pr/2811'
* processone/pr/2811:
  allow room recreate for admins even if nonempty
2019-03-11 23:30:22 +01:00
Holger Weiss
328553ea3f mod_push: Check for payload in encrypted messages
While distinguishing actual chat messages from other message types,
don't classify all <encrypted/> messages as chat messages, but only
those that have a <payload/> element.
2019-03-11 22:58:53 +01:00
Alexey Shchepin
e921b43754 Fix transaction aborting and restarting in ejabberd_sql 2019-03-07 22:14:13 +03:00
Christoph Scholz
b5fa3b0e2b allow room recreate for admins even if nonempty 2019-03-05 16:51:57 +01:00
Badlop
a4222fe9b3 Handle info log level when using MySQL (#2541) 2019-03-04 18:02:02 +01:00
Holger Weiss
2f46aebca2 mod_http_upload: Log nicer warning on unknown host
If an HTTP client issues a request against an unknown host, log a
readable warning (rather than an unreadable error) and respond with a
404 (rather than a 500) status.
2019-02-28 00:28:46 +01:00
Paweł Chmielowski
456e87e8b2 Copy p1_time_compat:unique_timestamp() to misc and make use of it 2019-02-27 11:00:02 +01:00
Paweł Chmielowski
538f35d05a Replace code using p1_time_compat wrapper with native functions
Since we now require R19, we shouldn't need that anymore.

There are still couple places where p1_time_compat:unique_timestamp() is
used as there is no direct equivalent.
2019-02-27 09:56:31 +01:00
Paweł Chmielowski
77ac0584ed Remove now() calls that sneaked in in pull requests 2019-02-27 09:56:31 +01:00
Evgeny Khramtsov
0250826cf9 Update mod_mqtt_mnesia.erl 2019-02-26 13:45:53 +03:00
Christoph Scholz
e257bc3d32 acl for mam_preferences 2019-02-25 22:21:30 +01:00
Paweł Chmielowski
d04a2454cc Add Accept header to requests issued by rest.erl 2019-02-25 16:18:13 +01:00
Evgeny Khramtsov
a3df791373 Add MQTT support 2019-02-25 11:42:09 +03:00
Holger Weiss
3491fa3fea mod_muc_admin: Fix indentation 2019-02-23 23:50:14 +01:00
Christoph Scholz
dd7754bc59 only destroy rooms if mam is enabled
when using ejabberdctl rooms_empty_list or rooms_empty_destroy only
select rooms that are have mam enabled. Otherwise you may accidently
destroy rooms which seem to be unsused due to archive being empty
2019-02-23 22:48:15 +01:00
Holger Weiss
f63dcdb790 mod_mam_sql: Improve check for empty archive
Avoid counting the messages of an archive to check whether it's empty.
2019-02-21 23:50:16 +01:00
Holger Weiss
9a3a7369cb mod_mam_mnesia: Fix check for empty archive
Don't return 'true' if the key exists but points to an empty archive.
Also, avoid looking up all keys.
2019-02-21 22:19:29 +01:00
Evgeny Khramtsov
1684436bfe Merge branch 'mix' 2019-02-21 12:36:33 +03:00
Holger Weiss
9c66cc5885 Merge remote-tracking branch 'processone/pr/2763'
* processone/pr/2763:
  disallow room creation if archive not empty and clear_archive_on_room_destroy is false
  check if mod_mam is loaded before calling mod_mam:is_empty_for_room
  added cmds to list and destroy empty rooms by ejabberdctl
  allow check if archive is empty for or user or room
  option to prevent archive removal on room destroy
2019-02-20 17:01:34 +01:00
Evgeny Khramtsov
8def827f9c Don't crash on malformed 'modules' section 2019-02-19 12:31:18 +03:00
Christoph Scholz
5e7f234ac8 disallow room creation if archive not empty and
clear_archive_on_room_destroy is false
2019-02-18 13:42:45 +01:00
Christoph Scholz
f987db5a39 check if mod_mam is loaded before calling mod_mam:is_empty_for_room 2019-02-18 13:42:45 +01:00
Christoph Scholz
a47c566b39 added cmds to list and destroy empty rooms by ejabberdctl 2019-02-18 13:42:45 +01:00
Christoph Scholz
2e586000d7 allow check if archive is empty for or user or room 2019-02-18 13:42:45 +01:00
Christoph Scholz
89b9e25588 option to prevent archive removal on room destroy 2019-02-18 13:42:45 +01:00
Paweł Chmielowski
b30775a357 Don't perform roster push for non-local contacts in mod_shared_roster
If group have member with jid from external server we tried to make
mod_roster sent roster push to it, and it sometimes didn't like to get
bogus data like that, so let's check if it's local user before doing this.
2019-02-18 12:37:42 +01:00
Holger Weiss
abdbc5df13 mod_push: Improve notification error handling
Don't disable push notifications if the app server returned a temporary
error, and log the app server's notification response.
2019-02-11 22:29:49 +01:00
Badlop
e18522f74c Once just_created isn't true, use it to keep room process creation (#2787) 2019-02-11 16:56:33 +01:00
Paweł Chmielowski
ea32d3f02c Send mucsub subscriber notification events with from set to room jid 2019-02-11 13:04:06 +01:00
Badlop
2819e26c8f Add notice about rooms_unused_destroy using the room history (#2787) 2019-02-06 16:34:02 +01:00
Badlop
6cd458d205 Don't consider room's lack of history when history_size is zero (#2787) 2019-02-06 16:33:59 +01:00
Badlop
c41c5b2185 Fix support to restart module with live options in WebAdmin 2019-02-06 13:30:30 +01:00
Badlop
7074a39ff3 Handle versioning result when shared roster group has remote account (#2692) 2019-02-06 12:36:01 +01:00
Badlop
8baced0d8b Merge branch 'mod_ping_no_kill' of https://github.com/fdie/ejabberd into 3 2019-02-01 16:21:58 +01:00
Frank Diebolt
4ff4711d4f catch badarg exceptions on invalid callback procs 2019-01-31 18:14:36 +01:00
Christophe Romain
9577fe3ba8 Fix argument name consistency 2019-01-31 18:05:39 +01:00
Frank Diebolt
9b66894dda ! may raise exceptions on invalid proc 2019-01-31 17:44:11 +01:00
Christophe Romain
ae7b391657 Do not overwrite odbc config file (#2295) 2019-01-31 13:25:56 +01:00