25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Rollback some Specs that break Dialyzer (thanks to Karim Gemayel)(EJAB-1345)

This commit is contained in:
Badlop 2010-11-10 21:27:53 +01:00
parent f4f949bd72
commit abf069da9e

View File

@ -680,12 +680,12 @@ send_loop(State) ->
%% %%
-spec(disco_local_identity/5 :: -spec(disco_local_identity/5 ::
( (
Acc :: [] | [Identity::#xmlel{name::'identity',ns::?NS_DISCO_INFO}], Acc :: [] | [Identity::#xmlel{}],
From :: jidEntity(), From :: jidEntity(),
To :: jidComponent(), To :: jidComponent(),
NodeId :: nodeId(), NodeId :: nodeId(),
Lang :: binary()) Lang :: binary())
-> Identities :: [] | [Identity::#xmlel{name::'identity',ns::?NS_DISCO_INFO}] -> Identities :: [] | [Identity::#xmlel{}]
). ).
disco_local_identity(Acc, _From, #jid{domain = Host} = _To, <<>> = _NodeId, _Lang) -> disco_local_identity(Acc, _From, #jid{domain = Host} = _To, <<>> = _NodeId, _Lang) ->
@ -723,12 +723,12 @@ disco_local_features(Acc, _From, _To, _NodeId, _Lang) ->
-spec(disco_local_items/5 :: -spec(disco_local_items/5 ::
( (
Acc :: {'result', Items :: [] | [Item::#xmlel{name::'item',ns::?NS_DISCO_INFO}]}, Acc :: {'result', Items :: [] | [Item::#xmlel{}]},
From :: jidEntity(), From :: jidEntity(),
To :: jidComponent(), To :: jidComponent(),
NodeId :: nodeId(), NodeId :: nodeId(),
Lang :: binary()) Lang :: binary())
-> {'result', Items :: [] | [Item::#xmlel{name::'item',ns::?NS_DISCO_INFO}]} -> {'result', Items :: [] | [Item::#xmlel{}]}
| {'error', _} %% TODO | {'error', _} %% TODO
). ).
@ -740,12 +740,12 @@ disco_local_items(Acc, _From, _To, _Node, _Lang) ->
-spec(disco_sm_identity/5 :: -spec(disco_sm_identity/5 ::
( (
Acc :: [] | [Identity::#xmlel{name::'identity',ns::?NS_DISCO_INFO}], Acc :: [] | [Identity::#xmlel{}],
From :: jidEntity(), From :: jidEntity(),
To :: jidContact(), To :: jidContact(),
NodeId :: nodeId(), NodeId :: nodeId(),
Lang :: binary()) Lang :: binary())
-> Identities :: [] | [Identity::#xmlel{name::'identity',ns::?NS_DISCO_INFO}] -> Identities :: [] | [Identity::#xmlel{}]
). ).
disco_sm_identity(Acc, From, To, NodeId, _Lang) -> disco_sm_identity(Acc, From, To, NodeId, _Lang) ->
@ -757,7 +757,7 @@ disco_sm_identity(Acc, From, To, NodeId, _Lang) ->
Host :: jidContact(), Host :: jidContact(),
NodeId :: nodeId(), NodeId :: nodeId(),
From :: jidEntity()) From :: jidEntity())
-> Identities :: [] | [Identity::#xmlel{name::'identity',ns::?NS_DISCO_INFO}] -> Identities :: [] | [Identity::#xmlel{}]
). ).
disco_identity(_Host, <<>> = _NodeId, _From) -> disco_identity(_Host, <<>> = _NodeId, _From) ->
@ -831,12 +831,12 @@ disco_features(#jid{node = U, domain = S, resource = R} = Host, NodeId, From) ->
-spec(disco_sm_items/5 :: -spec(disco_sm_items/5 ::
( (
Acc :: 'empty' Acc :: 'empty'
| {'result', Items :: [] | [Item::#xmlel{name::'item',ns::?NS_DISCO_INFO}]}, | {'result', Items :: [] | [Item::#xmlel{}]},
From :: jidEntity(), From :: jidEntity(),
To :: jidContact(), To :: jidContact(),
NodeId :: nodeId(), NodeId :: nodeId(),
Lang :: binary()) Lang :: binary())
-> {'result', Items :: [] | [Item::#xmlel{name::'item',ns::?NS_DISCO_INFO}]} -> {'result', Items :: [] | [Item::#xmlel{}]}
). ).
disco_sm_items('empty' = _Acc, From, To, NodeId, Lang) -> disco_sm_items('empty' = _Acc, From, To, NodeId, Lang) ->
@ -850,7 +850,7 @@ disco_sm_items({result, OtherItems} = _Acc, From, To, NodeId, _Lang) ->
Host :: jidContact(), Host :: jidContact(),
NodeId :: nodeId(), NodeId :: nodeId(),
From :: jidEntity()) From :: jidEntity())
-> Items :: [] | [Item::#xmlel{name::'item',ns::?NS_DISCO_INFO}] -> Items :: [] | [Item::#xmlel{}]
). ).
disco_items(#jid{raw = JID, node = U, domain = S, resource = R} = Host, <<>>, From) -> disco_items(#jid{raw = JID, node = U, domain = S, resource = R} = Host, <<>>, From) ->
@ -1071,7 +1071,7 @@ handle_cast(_Msg, State) ->
Info :: {'route', Info :: {'route',
From :: jidEntity(), From :: jidEntity(),
To :: jidComponent(), To :: jidComponent(),
Packet :: #xmlel{name :: 'iq' | 'message' | 'presence'}}, Packet :: #xmlel{}},
State :: #state{}) State :: #state{})
-> {'noreply', State::#state{}} -> {'noreply', State::#state{}}
). ).
@ -1155,7 +1155,7 @@ code_change(_OldVsn, State, _Extra) ->
Host :: hostPubsub(), Host :: hostPubsub(),
From :: jidEntity(), From :: jidEntity(),
To :: jidComponent(), To :: jidComponent(),
Packet :: #xmlel{name :: 'iq' | 'message' | 'presence'}) Packet :: #xmlel{})
-> any() -> any()
). ).
@ -1293,9 +1293,9 @@ do_route(_ServerHost, _Access, _Plugins, _Host, _From, _To, _Packet) ->
Host :: hostPubsub(), %% Host::host() TODO : implement ad hoc commands for PEP Host :: hostPubsub(), %% Host::host() TODO : implement ad hoc commands for PEP
NodeId :: nodeId(), NodeId :: nodeId(),
From :: jidEntity()) From :: jidEntity())
-> {result, Info::[#xmlel{name::'identity',ns::?NS_DISCO_INFO}]} -> {result, Info::[#xmlel{}]}
| {result, Info::[#xmlel{name::'identity',ns::?NS_DISCO_INFO} | {result, Info::[#xmlel{}
|#xmlel{name::'feature',ns::?NS_DISCO_INFO}]} |#xmlel{}]}
). ).
command_disco_info(_Host, ?NS_ADHOC_b = _NodeId, _From) -> command_disco_info(_Host, ?NS_ADHOC_b = _NodeId, _From) ->
@ -1322,8 +1322,8 @@ command_disco_info(_Host, ?NS_PUBSUB_GET_PENDING_b = _NodeId, _From) ->
Host :: hostPubsub(), Host :: hostPubsub(),
NodeId :: nodeId(), NodeId :: nodeId(),
From :: jidEntity()) From :: jidEntity())
-> {'result', [#xmlel{name::'identity',ns::?NS_DISCO_INFO} -> {'result', [#xmlel{}
|#xmlel{name::'feature',ns::?NS_DISCO_INFO}]} |#xmlel{}]}
| {'error', _} | {'error', _}
). ).
@ -1367,8 +1367,8 @@ node_disco_info(Host, NodeId, From) ->
NodeId :: nodeId(), NodeId :: nodeId(),
From :: jidEntity(), From :: jidEntity(),
Lang :: binary()) Lang :: binary())
-> {'result', [#xmlel{name::'identity',ns::?NS_DISCO_INFO} -> {'result', [#xmlel{}
|#xmlel{name::'feature',ns::?NS_DISCO_INFO}]} |#xmlel{}]}
| {'error', _} | {'error', _}
). ).
@ -1413,7 +1413,7 @@ iq_disco_info(Host, NodeId, From, _Lang) ->
Host :: hostPubsub(), Host :: hostPubsub(),
NodeId :: nodeId(), NodeId :: nodeId(),
From :: jidEntity()) From :: jidEntity())
-> {'result', [] | [#xmlel{name::'item',ns::?NS_DISCO_ITEMS}]} -> {'result', [] | [#xmlel{}]}
| {'error', _} | {'error', _}
). ).
@ -1505,8 +1505,8 @@ get_presence_and_roster_permissions(Host, From, Owners, AccessModel, AllowedGrou
( (
From :: jidEntity(), From :: jidEntity(),
To :: jidContact(), To :: jidContact(),
IQ :: #iq{type::'get'|'set',ns::?NS_PUBSUB|?NS_PUBSUB_OWNER}) IQ :: #iq{type::'get'|'set'})
-> #iq{type::'result'|'error',ns::?NS_PUBSUB|?NS_PUBSUB_OWNER} -> #iq{type::'result'|'error'}
). ).
iq_sm(From, #jid{node = U, domain = S, resource = undefined = R} = _To, iq_sm(From, #jid{node = U, domain = S, resource = undefined = R} = _To,
@ -1547,7 +1547,7 @@ iq_get_vcard(Lang) ->
ServerHost :: binary(), ServerHost :: binary(),
From :: jidEntity(), From :: jidEntity(),
IQType :: 'get' | 'set', IQType :: 'get' | 'set',
SubEl :: #xmlel{name::'pubsub',ns::?NS_PUBSUB}, SubEl :: #xmlel{},
Lang :: binary()) Lang :: binary())
-> {'result', Result::[] | #xmlel{}} | {'error', _} -> {'result', Result::[] | #xmlel{}} | {'error', _}
). ).
@ -1562,7 +1562,7 @@ iq_pubsub(Host, ServerHost, From, IQType, SubEl, Lang) ->
ServerHost :: binary(), ServerHost :: binary(),
From :: jidEntity(), From :: jidEntity(),
IQType :: 'get' | 'set', IQType :: 'get' | 'set',
SubEl :: #xmlel{name::'pubsub',ns::?NS_PUBSUB}, SubEl :: #xmlel{},
Lang :: binary(), Lang :: binary(),
Access :: atom(), Access :: atom(),
Plugins :: [Plugin::nodeType()]) Plugins :: [Plugin::nodeType()])
@ -1670,7 +1670,7 @@ iq_pubsub(Host, ServerHost, From, IQType, #xmlel{children = Els}, Lang, Access,
ServerHost :: binary(), ServerHost :: binary(),
From :: jidEntity(), From :: jidEntity(),
IQType :: 'get' | 'set', IQType :: 'get' | 'set',
SubEl :: #xmlel{name::'pubsub',ns::?NS_PUBSUB_OWNER}, SubEl :: #xmlel{},
Lang :: binary()) Lang :: binary())
-> {'result', Result::[] | #xmlel{}} | {'error', _} -> {'result', Result::[] | #xmlel{}} | {'error', _}
). ).
@ -1712,12 +1712,10 @@ iq_pubsub_owner(Host, ServerHost, From, IQType, #xmlel{children = Els}, Lang) ->
Host :: hostPubsub(), %% TODO : ad hoc commands for PEP Host :: hostPubsub(), %% TODO : ad hoc commands for PEP
ServerHost :: binary(), ServerHost :: binary(),
From :: jidEntity(), From :: jidEntity(),
IQ :: #iq{ IQ :: #iq{type :: 'set'},
type :: 'set',
ns :: ?NS_ADHOC},
Access :: atom(), Access :: atom(),
Plugins :: [Plugin::nodeType()]) Plugins :: [Plugin::nodeType()])
-> {'result', [Result::#xmlel{ns::?NS_ADHOC,name::'command'}]} -> {'result', [Result::#xmlel{}]}
| {'error', Error::_} | {'error', Error::_}
). ).
@ -4506,7 +4504,7 @@ itemAttr(ItemId) -> [?XMLATTR('id', ItemId)].
-spec(itemsEls/1 :: -spec(itemsEls/1 ::
( (
PubsubItems::[PubsubItem::pubsubItem()]) PubsubItems::[PubsubItem::pubsubItem()])
-> Items::[Item::#xmlel{name::'item',ns::?NS_PUBSUB}] -> Items::[Item::#xmlel{}]
). ).
itemsEls(PubsubItems) -> itemsEls(PubsubItems) ->