25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

prevent pubsub filtering too much packets

This commit is contained in:
Christophe Romain 2010-06-10 14:25:46 +02:00
parent 75053cf40d
commit a67539075f
3 changed files with 26 additions and 22 deletions

View File

@ -3995,6 +3995,8 @@ feature_check_packet(allow, _User, Server, Pres, {From, _To, El}, in) ->
feature_check_packet(Acc, _User, _Server, _Pres, _Packet, _Direction) -> feature_check_packet(Acc, _User, _Server, _Pres, _Packet, _Direction) ->
Acc. Acc.
is_feature_supported(_, []) ->
true;
is_feature_supported(#xmlel{name = 'presence', children = Els}, Feature) -> is_feature_supported(#xmlel{name = 'presence', children = Els}, Feature) ->
case mod_caps:read_caps(Els) of case mod_caps:read_caps(Els) of
nothing -> false; nothing -> false;

View File

@ -3759,8 +3759,8 @@ odbc_conn(Host) ->
lists:dropwhile(fun(A) -> A/=$. end, Host) -- ".". lists:dropwhile(fun(A) -> A/=$. end, Host) -- ".".
%% escape value for database storage %% escape value for database storage
escape({U, H, R})-> escape({_U, _H, _R}=JID)->
ejabberd_odbc:escape(exmpp_jid:to_list(U, H, R)); ejabberd_odbc:escape(exmpp_jid:to_list(JID));
escape(Value)-> escape(Value)->
ejabberd_odbc:escape(Value). ejabberd_odbc:escape(Value).
%%%% helpers %%%% helpers
@ -3867,6 +3867,8 @@ feature_check_packet(allow, _User, Server, Pres, {From, _To, El}, in) ->
feature_check_packet(Acc, _User, _Server, _Pres, _Packet, _Direction) -> feature_check_packet(Acc, _User, _Server, _Pres, _Packet, _Direction) ->
Acc. Acc.
is_feature_supported(_, []) ->
true;
is_feature_supported(#xmlel{name = 'presence', children = Els}, Feature) -> is_feature_supported(#xmlel{name = 'presence', children = Els}, Feature) ->
case mod_caps:read_caps(Els) of case mod_caps:read_caps(Els) of
nothing -> false; nothing -> false;

View File

@ -1,5 +1,5 @@
--- mod_pubsub.erl 2010-06-02 16:46:29.000000000 +0200 --- mod_pubsub.erl 2010-06-10 14:25:01.000000000 +0200
+++ mod_pubsub_odbc.erl 2010-06-02 16:46:33.000000000 +0200 +++ mod_pubsub_odbc.erl 2010-06-10 14:25:09.000000000 +0200
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
%%% 6.2.3.1, 6.2.3.5, and 6.3. For information on subscription leases see %%% 6.2.3.1, 6.2.3.5, and 6.3. For information on subscription leases see
%%% XEP-0060 section 12.18. %%% XEP-0060 section 12.18.