diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/adhoc.hrl | 2 | ||||
-rw-r--r-- | include/ejabberd.hrl | 2 | ||||
-rw-r--r-- | include/ejabberd_commands.hrl | 10 | ||||
-rw-r--r-- | include/ejabberd_config.hrl | 2 | ||||
-rw-r--r-- | include/ejabberd_ctl.hrl | 2 | ||||
-rw-r--r-- | include/ejabberd_http.hrl | 18 | ||||
-rw-r--r-- | include/ejabberd_sm.hrl | 5 | ||||
-rw-r--r-- | include/ejabberd_sql_pt.hrl | 33 | ||||
-rw-r--r-- | include/ejabberd_web_admin.hrl | 2 | ||||
-rw-r--r-- | include/eldap.hrl | 2 | ||||
-rw-r--r-- | include/http_bind.hrl | 7 | ||||
-rw-r--r-- | include/jlib.hrl | 6 | ||||
-rw-r--r-- | include/logger.hrl | 22 | ||||
-rw-r--r-- | include/mod_muc.hrl | 33 | ||||
-rw-r--r-- | include/mod_muc_room.hrl | 11 | ||||
-rw-r--r-- | include/mod_offline.hrl | 11 | ||||
-rw-r--r-- | include/mod_privacy.hrl | 2 | ||||
-rw-r--r-- | include/mod_proxy65.hrl | 2 | ||||
-rw-r--r-- | include/mod_roster.hrl | 2 | ||||
-rw-r--r-- | include/ns.hrl | 20 | ||||
-rw-r--r-- | include/pubsub.hrl | 6 |
21 files changed, 145 insertions, 55 deletions
diff --git a/include/adhoc.hrl b/include/adhoc.hrl index f16aedd3b..bd1bfaa6f 100644 --- a/include/adhoc.hrl +++ b/include/adhoc.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/include/ejabberd.hrl b/include/ejabberd.hrl index f07dc0aaf..6316d7813 100644 --- a/include/ejabberd.hrl +++ b/include/ejabberd.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/include/ejabberd_commands.hrl b/include/ejabberd_commands.hrl index 3ab15ca31..0742e3ba4 100644 --- a/include/ejabberd_commands.hrl +++ b/include/ejabberd_commands.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -34,7 +34,12 @@ module :: atom(), function :: atom(), args = [] :: [aterm()] | '_' | '$1' | '$2', - result = {res, rescode} :: rterm() | '_' | '$2'}). + policy = restricted :: open | restricted | admin | user, + result = {res, rescode} :: rterm() | '_' | '$2', + args_desc = none :: none | [string()] | '_', + result_desc = none :: none | string() | '_', + args_example = none :: none | [any()] | '_', + result_example = none :: any()}). -type ejabberd_commands() :: #ejabberd_commands{name :: atom(), tags :: [atom()], @@ -71,4 +76,3 @@ %% @type rterm() = {Name::atom(), Type::rtype()}. %% A result term is a tuple with the term name and the term type. - diff --git a/include/ejabberd_config.hrl b/include/ejabberd_config.hrl index eb4de2609..2d6889313 100644 --- a/include/ejabberd_config.hrl +++ b/include/ejabberd_config.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/include/ejabberd_ctl.hrl b/include/ejabberd_ctl.hrl index 8b56ad261..3951129e7 100644 --- a/include/ejabberd_ctl.hrl +++ b/include/ejabberd_ctl.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/include/ejabberd_http.hrl b/include/ejabberd_http.hrl index 50c9d4ad7..b8cbe3708 100644 --- a/include/ejabberd_http.hrl +++ b/include/ejabberd_http.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -19,7 +19,7 @@ %%%---------------------------------------------------------------------- -record(request, - {method, % :: method(), + {method :: method(), path = [] :: [binary()], q = [] :: [{binary() | nokey, binary()}], us = {<<>>, <<>>} :: {binary(), binary()}, @@ -30,14 +30,13 @@ ip :: {inet:ip_address(), inet:port_number()}, host = <<"">> :: binary(), port = 5280 :: inet:port_number(), - tp = http, % :: protocol(), opts = [] :: list(), + tp = http :: protocol(), headers = [] :: [{atom() | binary(), binary()}]}). - -record(ws, - {socket :: inet:socket() | p1_tls:tls_socket(), - sockmod = gen_tcp :: gen_tcp | p1_tls, + {socket :: inet:socket() | fast_tls:tls_socket(), + sockmod = gen_tcp :: gen_tcp | fast_tls, ip :: {inet:ip_address(), inet:port_number()}, host = <<"">> :: binary(), port = 5280 :: inet:port_number(), @@ -45,4 +44,9 @@ headers = [] :: [{atom() | binary(), binary()}], local_path = [] :: [binary()], q = [] :: [{binary() | nokey, binary()}], - buf :: binary()}). + buf :: binary(), + http_opts = [] :: list()}). + +-type method() :: 'GET' | 'HEAD' | 'DELETE' | 'OPTIONS' | 'PUT' | 'POST' | 'TRACE'. +-type protocol() :: http | https. +-type http_request() :: #request{}. diff --git a/include/ejabberd_sm.hrl b/include/ejabberd_sm.hrl index 756f4b888..bae60ccd3 100644 --- a/include/ejabberd_sm.hrl +++ b/include/ejabberd_sm.hrl @@ -1,3 +1,6 @@ +-ifndef(EJABBERD_SM_HRL). +-define(EJABBERD_SM_HRL, true). + -record(session, {sid, usr, us, priority, info}). -record(session_counter, {vhost, count}). -type sid() :: {erlang:timestamp(), pid()}. @@ -5,3 +8,5 @@ -type info() :: [{conn, atom()} | {ip, ip()} | {node, atom()} | {oor, boolean()} | {auth_module, atom()}]. -type prio() :: undefined | integer(). + +-endif. diff --git a/include/ejabberd_sql_pt.hrl b/include/ejabberd_sql_pt.hrl new file mode 100644 index 000000000..0048661da --- /dev/null +++ b/include/ejabberd_sql_pt.hrl @@ -0,0 +1,33 @@ +%%%---------------------------------------------------------------------- +%%% +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne +%%% +%%% This program is free software; you can redistribute it and/or +%%% modify it under the terms of the GNU General Public License as +%%% published by the Free Software Foundation; either version 2 of the +%%% License, or (at your option) any later version. +%%% +%%% This program is distributed in the hope that it will be useful, +%%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%%% General Public License for more details. +%%% +%%% You should have received a copy of the GNU General Public License along +%%% with this program; if not, write to the Free Software Foundation, Inc., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +%%% +%%%---------------------------------------------------------------------- + +-define(SQL_MARK, sql__mark_). +-define(SQL(SQL), ?SQL_MARK(SQL)). + +-define(SQL_UPSERT_MARK, sql_upsert__mark_). +-define(SQL_UPSERT(Host, Table, Fields), + ejabberd_odbc:sql_query(Host, ?SQL_UPSERT_MARK(Table, Fields))). +-define(SQL_UPSERT_T(Table, Fields), + ejabberd_odbc:sql_query_t(?SQL_UPSERT_MARK(Table, Fields))). + +-record(sql_query, {hash, format_query, format_res, args, loc}). + +-record(sql_escape, {string, integer, boolean}). + diff --git a/include/ejabberd_web_admin.hrl b/include/ejabberd_web_admin.hrl index 852e537b6..33ff3a451 100644 --- a/include/ejabberd_web_admin.hrl +++ b/include/ejabberd_web_admin.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/include/eldap.hrl b/include/eldap.hrl index 6c30f5456..6dfc894a8 100644 --- a/include/eldap.hrl +++ b/include/eldap.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/include/http_bind.hrl b/include/http_bind.hrl index 446e47105..cd8512f0e 100644 --- a/include/http_bind.hrl +++ b/include/http_bind.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -38,9 +38,12 @@ -define(AC_MAX_AGE, {<<"Access-Control-Max-Age">>, <<"86400">>}). +-define(NO_CACHE, + {<<"Cache-Control">>, <<"max-age=0, no-cache, no-store">>}). + -define(OPTIONS_HEADER, [?CT_PLAIN, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_METHODS, ?AC_ALLOW_HEADERS, ?AC_MAX_AGE]). -define(HEADER, - [?CT_XML, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_HEADERS]). + [?CT_XML, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_HEADERS, ?NO_CACHE]). diff --git a/include/jlib.hrl b/include/jlib.hrl index 1bda9a096..50a031334 100644 --- a/include/jlib.hrl +++ b/include/jlib.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -20,9 +20,9 @@ -include("ns.hrl"). -ifdef(NO_EXT_LIB). --include("xml.hrl"). +-include("fxml.hrl"). -else. --include_lib("p1_xml/include/xml.hrl"). +-include_lib("fast_xml/include/fxml.hrl"). -endif. -define(STANZA_ERROR(Code, Type, Condition), diff --git a/include/logger.hrl b/include/logger.hrl index b8fdc31f9..18dc7041c 100644 --- a/include/logger.hrl +++ b/include/logger.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -18,8 +18,6 @@ %%% %%%---------------------------------------------------------------------- -define(PRINT(Format, Args), io:format(Format, Args)). - --ifdef(LAGER). -compile([{parse_transform, lager_transform}]). -define(DEBUG(Format, Args), @@ -36,21 +34,3 @@ -define(CRITICAL_MSG(Format, Args), lager:critical(Format, Args)). - --else. - --define(DEBUG(Format, Args), - p1_logger:debug_msg(?MODULE, ?LINE, Format, Args)). - --define(INFO_MSG(Format, Args), - p1_logger:info_msg(?MODULE, ?LINE, Format, Args)). - --define(WARNING_MSG(Format, Args), - p1_logger:warning_msg(?MODULE, ?LINE, Format, Args)). - --define(ERROR_MSG(Format, Args), - p1_logger:error_msg(?MODULE, ?LINE, Format, Args)). - --define(CRITICAL_MSG(Format, Args), - p1_logger:critical_msg(?MODULE, ?LINE, Format, Args)). --endif. diff --git a/include/mod_muc.hrl b/include/mod_muc.hrl new file mode 100644 index 000000000..8d0c1b09d --- /dev/null +++ b/include/mod_muc.hrl @@ -0,0 +1,33 @@ +%%%---------------------------------------------------------------------- +%%% File : mod_muc.hrl +%%% +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne +%%% +%%% This program is free software; you can redistribute it and/or +%%% modify it under the terms of the GNU General Public License as +%%% published by the Free Software Foundation; either version 2 of the +%%% License, or (at your option) any later version. +%%% +%%% This program is distributed in the hope that it will be useful, +%%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%%% General Public License for more details. +%%% +%%% You should have received a copy of the GNU General Public License along +%%% with this program; if not, write to the Free Software Foundation, Inc., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +%%% +%%%---------------------------------------------------------------------- + +-record(muc_room, {name_host = {<<"">>, <<"">>} :: {binary(), binary()} | + {'_', binary()}, + opts = [] :: list() | '_'}). + +-record(muc_online_room, + {name_host = {<<"">>, <<"">>} :: {binary(), binary()} | '$1' | + {'_', binary()} | '_', + pid = self() :: pid() | '$2' | '_' | '$1'}). + +-record(muc_registered, + {us_host = {{<<"">>, <<"">>}, <<"">>} :: {{binary(), binary()}, binary()} | '$1', + nick = <<"">> :: binary()}). diff --git a/include/mod_muc_room.hrl b/include/mod_muc_room.hrl index 6f170269d..4d82856ca 100644 --- a/include/mod_muc_room.hrl +++ b/include/mod_muc_room.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -56,12 +56,15 @@ password_protected = false :: boolean(), password = <<"">> :: binary(), anonymous = true :: boolean(), + presence_broadcast = [moderator, participant, visitor] :: + [moderator | participant | visitor], allow_voice_requests = true :: boolean(), voice_request_min_interval = 1800 :: non_neg_integer(), max_users = ?MAX_USERS_DEFAULT :: non_neg_integer() | none, logging = false :: boolean(), vcard = <<"">> :: binary(), - captcha_whitelist = (?SETS):empty() :: ?TGB_SET + captcha_whitelist = (?SETS):empty() :: ?TGB_SET, + mam = false :: boolean() }). -type config() :: #config{}. @@ -110,8 +113,8 @@ -record(muc_online_users, {us = {<<>>, <<>>} :: {binary(), binary()}, resource = <<>> :: binary() | '_', - room = <<>> :: binary() | '_', - host = <<>> :: binary() | '_'}). + room = <<>> :: binary() | '_' | '$1', + host = <<>> :: binary() | '_' | '$2'}). -type muc_online_users() :: #muc_online_users{}. diff --git a/include/mod_offline.hrl b/include/mod_offline.hrl new file mode 100644 index 000000000..c4c70604a --- /dev/null +++ b/include/mod_offline.hrl @@ -0,0 +1,11 @@ +-record(offline_msg, + {us = {<<"">>, <<"">>} :: {binary(), binary()}, + timestamp = now() :: erlang:timestamp() | '_', + expire = now() :: erlang:timestamp() | never | '_', + from = #jid{} :: jid() | '_', + to = #jid{} :: jid() | '_', + packet = #xmlel{} :: xmlel() | '_'}). + +-record(state, + {host = <<"">> :: binary(), + access_max_offline_messages}). diff --git a/include/mod_privacy.hrl b/include/mod_privacy.hrl index b3dfd4e7c..8fe5abcca 100644 --- a/include/mod_privacy.hrl +++ b/include/mod_privacy.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/include/mod_proxy65.hrl b/include/mod_proxy65.hrl index 70181bf82..1d8ceb3c6 100644 --- a/include/mod_proxy65.hrl +++ b/include/mod_proxy65.hrl @@ -2,7 +2,7 @@ %%% RFC 1928 constants. %%% %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/include/mod_roster.hrl b/include/mod_roster.hrl index ea060a5cb..b05114e3e 100644 --- a/include/mod_roster.hrl +++ b/include/mod_roster.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/include/ns.hrl b/include/ns.hrl index a96edc7ab..c7f556372 100644 --- a/include/ns.hrl +++ b/include/ns.hrl @@ -1,6 +1,6 @@ %%%---------------------------------------------------------------------- %%% -%%% ejabberd, Copyright (C) 2002-2015 ProcessOne +%%% ejabberd, Copyright (C) 2002-2016 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -35,12 +35,10 @@ -define(NS_BLOCKING, <<"urn:xmpp:blocking">>). -define(NS_PRIVATE, <<"jabber:iq:private">>). -define(NS_VERSION, <<"jabber:iq:version">>). --define(NS_TIME90, <<"jabber:iq:time">>). -define(NS_TIME, <<"urn:xmpp:time">>). -define(NS_LAST, <<"jabber:iq:last">>). -define(NS_XDATA, <<"jabber:x:data">>). -define(NS_IQDATA, <<"jabber:iq:data">>). --define(NS_DELAY91, <<"jabber:x:delay">>). -define(NS_DELAY, <<"urn:xmpp:delay">>). -define(NS_HINTS, <<"urn:xmpp:hints">>). -define(NS_EXPIRE, <<"jabber:x:expire">>). @@ -133,6 +131,7 @@ -define(NS_FEATURE_COMPRESS, <<"http://jabber.org/features/compress">>). -define(NS_FEATURE_MSGOFFLINE, <<"msgoffline">>). +-define(NS_FLEX_OFFLINE, <<"http://jabber.org/protocol/offline">>). -define(NS_COMPRESS, <<"http://jabber.org/protocol/compress">>). -define(NS_CAPS, <<"http://jabber.org/protocol/caps">>). @@ -143,6 +142,10 @@ -define(NS_CAPTCHA, <<"urn:xmpp:captcha">>). -define(NS_MEDIA, <<"urn:xmpp:media-element">>). -define(NS_BOB, <<"urn:xmpp:bob">>). +-define(NS_MAM_TMP, <<"urn:xmpp:mam:tmp">>). +-define(NS_MAM_0, <<"urn:xmpp:mam:0">>). +-define(NS_MAM_1, <<"urn:xmpp:mam:1">>). +-define(NS_SID_0, <<"urn:xmpp:sid:0">>). -define(NS_PING, <<"urn:xmpp:ping">>). -define(NS_CARBONS_2, <<"urn:xmpp:carbons:2">>). -define(NS_CARBONS_1, <<"urn:xmpp:carbons:1">>). @@ -150,3 +153,14 @@ -define(NS_CLIENT_STATE, <<"urn:xmpp:csi:0">>). -define(NS_STREAM_MGMT_2, <<"urn:xmpp:sm:2">>). -define(NS_STREAM_MGMT_3, <<"urn:xmpp:sm:3">>). +-define(NS_HTTP_UPLOAD, <<"urn:xmpp:http:upload">>). +-define(NS_HTTP_UPLOAD_OLD, <<"eu:siacs:conversations:http:upload">>). +-define(NS_THUMBS_1, <<"urn:xmpp:thumbs:1">>). +-define(NS_NICK, <<"http://jabber.org/protocol/nick">>). +-define(NS_MIX_0, <<"urn:xmpp:mix:0">>). +-define(NS_MIX_SERVICEINFO_0, <<"urn:xmpp:mix:0#serviceinfo">>). +-define(NS_MIX_NODES_MESSAGES, <<"urn:xmpp:mix:nodes:messages">>). +-define(NS_MIX_NODES_PRESENCE, <<"urn:xmpp:mix:nodes:presence">>). +-define(NS_MIX_NODES_PARTICIPANTS, <<"urn:xmpp:mix:nodes:participants">>). +-define(NS_MIX_NODES_SUBJECT, <<"urn:xmpp:mix:nodes:subject">>). +-define(NS_MIX_NODES_CONFIG, <<"urn:xmpp:mix:nodes:config">>). diff --git a/include/pubsub.hrl b/include/pubsub.hrl index f43e1644b..209f802db 100644 --- a/include/pubsub.hrl +++ b/include/pubsub.hrl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2015, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2016, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2015, ProcessOne. +%%% This software is copyright 2006-2016, ProcessOne. %%% %%% -%%% copyright 2006-2015 ProcessOne +%%% copyright 2006-2016 ProcessOne %%% %%% This file contains pubsub types definition. %%% ==================================================================== |