25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

* doc/api/Makefile: Report the correct ejabberd version. When

cleaning, remove also erlang.png

* src/mod_muc/mod_muc_room.erl: Update source code to prevent
warning messages from EDoc
* src/mod_pubsub/mod_pubsub.erl: Likewise
* src/mod_pubsub/node_default.erl: Likewise
* src/mod_pubsub/nodetree_default.erl: Likewise
* src/mod_pubsub/nodetree_virtual.erl: Likewise
* src/mod_pubsub/pubsub.hrl: Likewise

SVN Revision: 1265
This commit is contained in:
Badlop 2008-04-01 10:11:39 +00:00
parent 273c076ef6
commit 5fd627b85b
8 changed files with 113 additions and 90 deletions

View File

@ -1,3 +1,16 @@
2008-04-01 Badlop <badlop@process-one.net>
* doc/api/Makefile: Report the correct ejabberd version. When
cleaning, remove also erlang.png
* src/mod_muc/mod_muc_room.erl: Update source code to prevent
warning messages from EDoc
* src/mod_pubsub/mod_pubsub.erl: Likewise
* src/mod_pubsub/node_default.erl: Likewise
* src/mod_pubsub/nodetree_default.erl: Likewise
* src/mod_pubsub/nodetree_virtual.erl: Likewise
* src/mod_pubsub/pubsub.hrl: Likewise
2008-04-01 Christophe Romain <christophe.romain@process-one.net> 2008-04-01 Christophe Romain <christophe.romain@process-one.net>
* src/ejabberdctl.template: Add firewalling port range definition * src/ejabberdctl.template: Add firewalling port range definition

View File

@ -1,5 +1,5 @@
APPNAME = ejabberd APPNAME = ejabberd
VSN = SVN VSN = $(shell sed '/VERSION/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../../src/ejabberd.hrl)
DOCDIR=. DOCDIR=.
SRCDIR=../../src SRCDIR=../../src
@ -11,6 +11,7 @@ all: docs
clean: clean:
rm -f *.html rm -f *.html
rm edoc-info rm edoc-info
rm erlang.png
docs: docs:
erl -noshell -run edoc_run application \ erl -noshell -run edoc_run application \

View File

@ -2818,21 +2818,21 @@ set_opts([], StateData) ->
StateData; StateData;
set_opts([{Opt, Val} | Opts], StateData) -> set_opts([{Opt, Val} | Opts], StateData) ->
NSD = case Opt of NSD = case Opt of
?CASE_CONFIG_OPT(title); title -> StateData#state{config = (StateData#state.config)#config{title = Val}};
?CASE_CONFIG_OPT(allow_change_subj); allow_change_subj -> StateData#state{config = (StateData#state.config)#config{allow_change_subj = Val}};
?CASE_CONFIG_OPT(allow_query_users); allow_query_users -> StateData#state{config = (StateData#state.config)#config{allow_query_users = Val}};
?CASE_CONFIG_OPT(allow_private_messages); allow_private_messages -> StateData#state{config = (StateData#state.config)#config{allow_private_messages = Val}};
?CASE_CONFIG_OPT(public); public -> StateData#state{config = (StateData#state.config)#config{public = Val}};
?CASE_CONFIG_OPT(public_list); public_list -> StateData#state{config = (StateData#state.config)#config{public_list = Val}};
?CASE_CONFIG_OPT(persistent); persistent -> StateData#state{config = (StateData#state.config)#config{persistent = Val}};
?CASE_CONFIG_OPT(moderated); moderated -> StateData#state{config = (StateData#state.config)#config{moderated = Val}};
?CASE_CONFIG_OPT(members_by_default); members_by_default -> StateData#state{config = (StateData#state.config)#config{members_by_default = Val}};
?CASE_CONFIG_OPT(members_only); members_only -> StateData#state{config = (StateData#state.config)#config{members_only = Val}};
?CASE_CONFIG_OPT(allow_user_invites); allow_user_invites -> StateData#state{config = (StateData#state.config)#config{allow_user_invites = Val}};
?CASE_CONFIG_OPT(password_protected); password_protected -> StateData#state{config = (StateData#state.config)#config{password_protected = Val}};
?CASE_CONFIG_OPT(password); password -> StateData#state{config = (StateData#state.config)#config{password = Val}};
?CASE_CONFIG_OPT(anonymous); anonymous -> StateData#state{config = (StateData#state.config)#config{anonymous = Val}};
?CASE_CONFIG_OPT(logging); logging -> StateData#state{config = (StateData#state.config)#config{logging = Val}};
max_users -> max_users ->
ServiceMaxUsers = get_service_max_users(StateData), ServiceMaxUsers = get_service_max_users(StateData),
MaxUsers = if MaxUsers = if

View File

@ -33,7 +33,7 @@
%%% This module uses version 1.10 of the specification as a base. %%% This module uses version 1.10 of the specification as a base.
%%% Most of the specification is implemented. %%% Most of the specification is implemented.
%%% Code is derivated from the original pubsub v1.7, functions concerning config may be rewritten. %%% Code is derivated from the original pubsub v1.7, functions concerning config may be rewritten.
%%% Code also inspired from the original PEP patch by Magnus Henoch <mange@freemail.hu> %%% Code also inspired from the original PEP patch by Magnus Henoch (mangeATfreemail.hu)
%%% TODO %%% TODO
%%% plugin: generate Reply (do not use broadcast atom anymore) %%% plugin: generate Reply (do not use broadcast atom anymore)
@ -190,7 +190,7 @@ init([ServerHost, Opts]) ->
nodetree = NodeTree, nodetree = NodeTree,
plugins = Plugins}}. plugins = Plugins}}.
%% @spec (Host, Opts) -> Plugins %% @spec (Host, ServerHost, Opts) -> Plugins
%% Host = mod_pubsub:host() Opts = [{Key,Value}] %% Host = mod_pubsub:host() Opts = [{Key,Value}]
%% ServerHost = host() %% ServerHost = host()
%% Key = atom() %% Key = atom()
@ -1121,19 +1121,19 @@ handle_authorization_response(Host, From, To, Packet, XFields) ->
%% @doc <p>Create new pubsub nodes</p> %% @doc <p>Create new pubsub nodes</p>
%%<p>In addition to method-specific error conditions, there are several general reasons why the node creation request might fail:</p> %%<p>In addition to method-specific error conditions, there are several general reasons why the node creation request might fail:</p>
%%<ul> %%<ul>
%%<li>The service does not support node creation. %%<li>The service does not support node creation.</li>
%%<li>Only entities that are registered with the service are allowed to create nodes but the requesting entity is not registered. %%<li>Only entities that are registered with the service are allowed to create nodes but the requesting entity is not registered.</li>
%%<li>The requesting entity does not have sufficient privileges to create nodes. %%<li>The requesting entity does not have sufficient privileges to create nodes.</li>
%%<li>The requested NodeID already exists. %%<li>The requested NodeID already exists.</li>
%%<li>The request did not include a NodeID and "instant nodes" are not supported. %%<li>The request did not include a NodeID and "instant nodes" are not supported.</li>
%%</ul> %%</ul>
%%<p>ote: node creation is a particular case, error return code is evaluated at many places:</p> %%<p>ote: node creation is a particular case, error return code is evaluated at many places:</p>
%%<ul> %%<ul>
%%<li>iq_pubsub checks if service supports node creation (type exists) %%<li>iq_pubsub checks if service supports node creation (type exists)</li>
%%<li>create_node checks if instant nodes are supported %%<li>create_node checks if instant nodes are supported</li>
%%<li>create_node asks node plugin if entity have sufficient privilege %%<li>create_node asks node plugin if entity have sufficient privilege</li>
%%<li>nodetree create_node checks if nodeid already exists %%<li>nodetree create_node checks if nodeid already exists</li>
%%<li>node plugin create_node just sets default affiliation/subscription %%<li>node plugin create_node just sets default affiliation/subscription</li>
%%</ul> %%</ul>
create_node(Host, ServerHost, Node, Owner, Type) -> create_node(Host, ServerHost, Node, Owner, Type) ->
create_node(Host, ServerHost, Node, Owner, Type, all, []). create_node(Host, ServerHost, Node, Owner, Type, all, []).
@ -1245,9 +1245,9 @@ create_node(Host, ServerHost, Node, Owner, GivenType, Access, Configuration) ->
%% @doc <p>Delete specified node and all childs.</p> %% @doc <p>Delete specified node and all childs.</p>
%%<p>There are several reasons why the node deletion request might fail:</p> %%<p>There are several reasons why the node deletion request might fail:</p>
%%<ul> %%<ul>
%%<li>The requesting entity does not have sufficient privileges to delete the node. %%<li>The requesting entity does not have sufficient privileges to delete the node.</li>
%%<li>The node is the root collection node, which cannot be deleted. %%<li>The node is the root collection node, which cannot be deleted.</li>
%%<li>The specified node does not exist. %%<li>The specified node does not exist.</li>
%%</ul> %%</ul>
delete_node(_Host, [], _Owner) -> delete_node(_Host, [], _Owner) ->
%% Node is the root %% Node is the root
@ -1299,20 +1299,20 @@ delete_nodes(Host, Owner) ->
%% Node = pubsubNode() %% Node = pubsubNode()
%% From = jid() %% From = jid()
%% JID = jid() %% JID = jid()
%% @doc <p>Accepts or rejects subcription requests on a PubSub node.</p>
%% @see node_default:subscribe_node/5 %% @see node_default:subscribe_node/5
%% @doc <p>Accepts or rejects subcription requests on a PubSub node.</p>
%%<p>There are several reasons why the subscription request might fail:</p> %%<p>There are several reasons why the subscription request might fail:</p>
%%<ul> %%<ul>
%%<li>The bare JID portions of the JIDs do not match. %%<li>The bare JID portions of the JIDs do not match.</li>
%%<li>The node has an access model of "presence" and the requesting entity is not subscribed to the owner's presence. %%<li>The node has an access model of "presence" and the requesting entity is not subscribed to the owner's presence.</li>
%%<li>The node has an access model of "roster" and the requesting entity is not in one of the authorized roster groups. %%<li>The node has an access model of "roster" and the requesting entity is not in one of the authorized roster groups.</li>
%%<li>The node has an access model of "whitelist" and the requesting entity is not on the whitelist. %%<li>The node has an access model of "whitelist" and the requesting entity is not on the whitelist.</li>
%%<li>The service requires payment for subscriptions to the node. %%<li>The service requires payment for subscriptions to the node.</li>
%%<li>The requesting entity is anonymous and the service does not allow anonymous entities to subscribe. %%<li>The requesting entity is anonymous and the service does not allow anonymous entities to subscribe.</li>
%%<li>The requesting entity has a pending subscription. %%<li>The requesting entity has a pending subscription.</li>
%%<li>The requesting entity is blocked from subscribing (e.g., because having an affiliation of outcast). %%<li>The requesting entity is blocked from subscribing (e.g., because having an affiliation of outcast).</li>
%%<li>The node does not support subscriptions. %%<li>The node does not support subscriptions.</li>
%%<li>The node does not exist. %%<li>The node does not exist.</li>
%%</ul> %%</ul>
subscribe_node(Host, Node, From, JID) -> subscribe_node(Host, Node, From, JID) ->
Subscriber = case jlib:string_to_jid(JID) of Subscriber = case jlib:string_to_jid(JID) of
@ -1385,7 +1385,7 @@ subscribe_node(Host, Node, From, JID) ->
{result, Result} {result, Result}
end. end.
%% @spec (Host, Noce, From, JID) -> {error, Reason} | {result, []} %% @spec (Host, Noce, From, JID, SubId) -> {error, Reason} | {result, []}
%% Host = host() %% Host = host()
%% Node = pubsubNode() %% Node = pubsubNode()
%% From = jid() %% From = jid()
@ -1395,12 +1395,12 @@ subscribe_node(Host, Node, From, JID) ->
%% @doc <p>Unsubscribe <tt>JID</tt> from the <tt>Node</tt>.</p> %% @doc <p>Unsubscribe <tt>JID</tt> from the <tt>Node</tt>.</p>
%%<p>There are several reasons why the unsubscribe request might fail:</p> %%<p>There are several reasons why the unsubscribe request might fail:</p>
%%<ul> %%<ul>
%%<li>The requesting entity has multiple subscriptions to the node but does not specify a subscription ID. %%<li>The requesting entity has multiple subscriptions to the node but does not specify a subscription ID.</li>
%%<li>The request does not specify an existing subscriber. %%<li>The request does not specify an existing subscriber.</li>
%%<li>The requesting entity does not have sufficient privileges to unsubscribe the specified JID. %%<li>The requesting entity does not have sufficient privileges to unsubscribe the specified JID.</li>
%%<li>The node does not exist. %%<li>The node does not exist.</li>
%%<li>The request specifies a subscription ID that is not valid or current. %%<li>The request specifies a subscription ID that is not valid or current.</li>
%%</il> %%</ul>
unsubscribe_node(Host, Node, From, JID, SubId) -> unsubscribe_node(Host, Node, From, JID, SubId) ->
Subscriber = case jlib:string_to_jid(JID) of Subscriber = case jlib:string_to_jid(JID) of
error -> {"", "", ""}; error -> {"", "", ""};
@ -1423,12 +1423,12 @@ unsubscribe_node(Host, Node, From, JID, SubId) ->
%% <p>The permission to publish an item must be verified by the plugin implementation.</p> %% <p>The permission to publish an item must be verified by the plugin implementation.</p>
%%<p>There are several reasons why the publish request might fail:</p> %%<p>There are several reasons why the publish request might fail:</p>
%%<ul> %%<ul>
%%<li>The requesting entity does not have sufficient privileges to publish. %%<li>The requesting entity does not have sufficient privileges to publish.</li>
%%<li>The node does not support item publication. %%<li>The node does not support item publication.</li>
%%<li>The node does not exist. %%<li>The node does not exist.</li>
%%<li>The payload size exceeds a service-defined limit. %%<li>The payload size exceeds a service-defined limit.</li>
%%<li>The item contains more than one payload element or the namespace of the root payload element does not match the configured namespace for the node. %%<li>The item contains more than one payload element or the namespace of the root payload element does not match the configured namespace for the node.</li>
%%<li>The request does not match the node configuration. %%<li>The request does not match the node configuration.</li>
%%</ul> %%</ul>
publish_item(Host, ServerHost, Node, Publisher, "", Payload) -> publish_item(Host, ServerHost, Node, Publisher, "", Payload) ->
%% if publisher does not specify an ItemId, the service MUST generate the ItemId %% if publisher does not specify an ItemId, the service MUST generate the ItemId
@ -1524,12 +1524,12 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload) ->
%% <p>The permission to delete an item must be verified by the plugin implementation.</p> %% <p>The permission to delete an item must be verified by the plugin implementation.</p>
%%<p>There are several reasons why the item retraction request might fail:</p> %%<p>There are several reasons why the item retraction request might fail:</p>
%%<ul> %%<ul>
%%<li>The publisher does not have sufficient privileges to delete the requested item. %%<li>The publisher does not have sufficient privileges to delete the requested item.</li>
%%<li>The node or item does not exist. %%<li>The node or item does not exist.</li>
%%<li>The request does not specify a node. %%<li>The request does not specify a node.</li>
%%<li>The request does not include an <item/> element or the <item/> element does not specify an ItemId. %%<li>The request does not include an <item/> element or the <item/> element does not specify an ItemId.</li>
%%<li>The node does not support persistent items. %%<li>The node does not support persistent items.</li>
%%<li>The service does not support the deletion of items. %%<li>The service does not support the deletion of items.</li>
%%</ul> %%</ul>
delete_item(Host, Node, Publisher, ItemId) -> delete_item(Host, Node, Publisher, ItemId) ->
delete_item(Host, Node, Publisher, ItemId, false). delete_item(Host, Node, Publisher, ItemId, false).
@ -1580,10 +1580,10 @@ delete_item(Host, Node, Publisher, ItemId, ForceNotify) ->
%% @doc <p>Delete all items of specified node owned by JID.</p> %% @doc <p>Delete all items of specified node owned by JID.</p>
%%<p>There are several reasons why the node purge request might fail:</p> %%<p>There are several reasons why the node purge request might fail:</p>
%%<ul> %%<ul>
%%<li>The node or service does not support node purging. %%<li>The node or service does not support node purging.</li>
%%<li>The requesting entity does not have sufficient privileges to purge the node. %%<li>The requesting entity does not have sufficient privileges to purge the node.</li>
%%<li>The node is not configured to persist items. %%<li>The node is not configured to persist items.</li>
%%<li>The specified node does not exist. %%<li>The specified node does not exist.</li>
%%</ul> %%</ul>
purge_node(Host, Node, Owner) -> purge_node(Host, Node, Owner) ->
Action = fun(#pubsub_node{type = Type, options = Options}) -> Action = fun(#pubsub_node{type = Type, options = Options}) ->
@ -1670,7 +1670,7 @@ get_items(Host, Node) ->
%% @spec (Host, Node, LJID) -> any() %% @spec (Host, Node, LJID) -> any()
%% Host = host() %% Host = host()
%% Node = pubsubNode() %% Node = pubsubNode()
%% LJID = {U,S,""} %% LJID = {U, S, []}
%% @doc <p>Resend the items of a node to the user.</p> %% @doc <p>Resend the items of a node to the user.</p>
send_all_items(Host, Node, LJID) -> send_all_items(Host, Node, LJID) ->
send_items(Host, Node, LJID, all). send_items(Host, Node, LJID, all).
@ -1949,7 +1949,8 @@ set_subscriptions(Host, Node, From, EntitiesEls) ->
end. end.
% @spec (OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, _}, AllowedGroups) %% @spec (OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, SubscriberResource}, AllowedGroups)
%% -> {PresenceSubscription, RosterGroup}
get_roster_info(OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, _}, AllowedGroups) -> get_roster_info(OwnerUser, OwnerServer, {SubscriberUser, SubscriberServer, _}, AllowedGroups) ->
{Subscription, Groups} = {Subscription, Groups} =
ejabberd_hooks:run_fold( ejabberd_hooks:run_fold(
@ -2022,11 +2023,11 @@ service_jid(Host) ->
_ -> {jid, "", Host, "", "", Host, ""} _ -> {jid, "", Host, "", "", Host, ""}
end. end.
%% @spec (LJID, PresenceDelivery) -> boolean() %% @spec (LJID, Subscription, PresenceDelivery) -> boolean()
%% LJID = jid() %% LJID = jid()
%% Subscription = atom() %% Subscription = atom()
%% PresenceDelivery = boolean() %% PresenceDelivery = boolean()
%% @doc <p>Check if a notification must be delivered or not %% @doc <p>Check if a notification must be delivered or not.</p>
is_to_delivered(_, none, _) -> false; is_to_delivered(_, none, _) -> false;
is_to_delivered(_, pending, _) -> false; is_to_delivered(_, pending, _) -> false;
is_to_delivered(_, _, false) -> true; is_to_delivered(_, _, false) -> true;
@ -2325,8 +2326,8 @@ is_caps_notify(Host, Node, Caps) ->
%%<p>There are several reasons why the default node configuration options request might fail:</p> %%<p>There are several reasons why the default node configuration options request might fail:</p>
%%<ul> %%<ul>
%%<li>The service does not support node configuration. %%<li>The service does not support node configuration.</li>
%%<li>The service does not support retrieval of default node configuration. %%<li>The service does not support retrieval of default node configuration.</li>
%%</ul> %%</ul>
get_configure(Host, Node, From, Lang) -> get_configure(Host, Node, From, Lang) ->
Action = Action =
@ -2460,11 +2461,11 @@ get_configure_xfields(_Type, Options, _Owners, Lang) ->
%%<p>There are several reasons why the node configuration request might fail:</p> %%<p>There are several reasons why the node configuration request might fail:</p>
%%<ul> %%<ul>
%%<li>The service does not support node configuration. %%<li>The service does not support node configuration.</li>
%%<li>The requesting entity does not have sufficient privileges to configure the node. %%<li>The requesting entity does not have sufficient privileges to configure the node.</li>
%%<li>The request did not specify a node. %%<li>The request did not specify a node.</li>
%%<li>The node has no configuration options. %%<li>The node has no configuration options.</li>
%%<li>The specified node does not exist. %%<li>The specified node does not exist.</li>
%%</ul> %%</ul>
set_configure(Host, Node, From, Els, Lang) -> set_configure(Host, Node, From, Els, Lang) ->
case xml:remove_cdata(Els) of case xml:remove_cdata(Els) of

View File

@ -79,9 +79,9 @@
%% API definition %% API definition
%% ================ %% ================
%% @spec (Host) -> any() %% @spec (Host, ServerHost, Opts) -> any()
%% Host = mod_pubsub:host() %% Host = mod_pubsub:host()
%% ServerHost = host() %% ServerHost = mod_pubsub:host()
%% Opts = list() %% Opts = list()
%% @doc <p>Called during pubsub modules initialisation. Any pubsub plugin must %% @doc <p>Called during pubsub modules initialisation. Any pubsub plugin must
%% implement this function. It can return anything.</p> %% implement this function. It can return anything.</p>
@ -109,8 +109,9 @@ init(_Host, _ServerHost, _Opts) ->
end, end,
ok. ok.
%% @spec (Host) -> any() %% @spec (Host, ServerHost) -> any()
%% Host = mod_pubsub:host() %% Host = mod_pubsub:host()
%% ServerHost = host()
%% @doc <p>Called during pubsub modules termination. Any pubsub plugin must %% @doc <p>Called during pubsub modules termination. Any pubsub plugin must
%% implement this function. It can return anything.</p> %% implement this function. It can return anything.</p>
terminate(_Host, _ServerHost) -> terminate(_Host, _ServerHost) ->
@ -172,10 +173,11 @@ features() ->
"subscription-notifications" "subscription-notifications"
]. ].
%% @spec (Host, Node, Owner, Access) -> bool() %% @spec (Host, ServerHost, Node, ParentNode, Owner, Access) -> bool()
%% Host = mod_pubsub:host() %% Host = mod_pubsub:host()
%% ServerHost = mod_pubsub:host() %% ServerHost = mod_pubsub:host()
%% Node = mod_pubsub:pubsubNode() %% Node = mod_pubsub:pubsubNode()
%% ParentNode = mod_pubsub:pubsubNode()
%% Owner = mod_pubsub:jid() %% Owner = mod_pubsub:jid()
%% Access = all | atom() %% Access = all | atom()
%% @doc Checks if the current user has the permission to create the requested node %% @doc Checks if the current user has the permission to create the requested node
@ -246,7 +248,7 @@ delete_node(Host, Removed) ->
end, Removed), end, Removed),
{result, {default, broadcast, Removed}}. {result, {default, broadcast, Removed}}.
%% @spec (Host, Node, Sender, Subscriber, AccessModel, SendLast) -> %% @spec (Host, Node, Sender, Subscriber, AccessModel, SendLast, PresenceSubscription, RosterGroup) ->
%% {error, Reason} | {result, Result} %% {error, Reason} | {result, Result}
%% @doc <p>Accepts or rejects subcription requests on a PubSub node.</p> %% @doc <p>Accepts or rejects subcription requests on a PubSub node.</p>
%% <p>The mechanism works as follow: %% <p>The mechanism works as follow:
@ -531,7 +533,12 @@ delete_item(Host, Node, Publisher, ItemId) ->
end end
end. end.
%% @spec (TODO) %% @spec (Host, Node, Owner) ->
%% {error, Reason::stanzaError()} |
%% {result, {default, broadcast}}
%% Host = mod_pubsub:host()
%% Node = mod_pubsub:pubsubNode()
%% Owner = mod_pubsub:jid()
purge_node(Host, Node, Owner) -> purge_node(Host, Node, Owner) ->
OwnerKey = jlib:jid_tolower(jlib:jid_remove_resource(Owner)), OwnerKey = jlib:jid_tolower(jlib:jid_remove_resource(Owner)),
case get_state(Host, Node, OwnerKey) of case get_state(Host, Node, OwnerKey) of
@ -597,9 +604,10 @@ set_affiliation(Host, Node, Owner, Affiliation) ->
set_state(Record), set_state(Record),
ok. ok.
%% @spec (Host) -> [{Node,Subscription}] %% @spec (Host, Owner) -> [{Node,Subscription}]
%% Host = host() %% Host = host()
%% JID = mod_pubsub:jid() %% Owner = mod_pubsub:jid()
%% Node = mod_pubsub:pubsubNode()
%% @doc <p>Return the current subscriptions for the given user</p> %% @doc <p>Return the current subscriptions for the given user</p>
%% <p>The default module reads subscriptions in the main Mnesia %% <p>The default module reads subscriptions in the main Mnesia
%% <tt>pubsub_state</tt> table. If a plugin stores its data in the same %% <tt>pubsub_state</tt> table. If a plugin stores its data in the same
@ -679,7 +687,7 @@ get_state(Host, Node, JID) ->
{error, ?ERR_ITEM_NOT_FOUND} {error, ?ERR_ITEM_NOT_FOUND}
end. end.
%% @spec (State) -> ok | {error, ?ERR_INTERNAL_SERVER_ERROR} %% @spec (State) -> ok | {error, Reason::stanzaError()}
%% State = mod_pubsub:pubsubStates() %% State = mod_pubsub:pubsubStates()
%% @doc <p>Write a state into database.</p> %% @doc <p>Write a state into database.</p>
set_state(State) when is_record(State, pubsub_state) -> set_state(State) when is_record(State, pubsub_state) ->
@ -720,7 +728,7 @@ get_item(Host, Node, ItemId) ->
{error, ?ERR_ITEM_NOT_FOUND} {error, ?ERR_ITEM_NOT_FOUND}
end. end.
%% @spec (Item) -> ok | {error, ?ERR_INTERNAL_SERVER_ERROR} %% @spec (Item) -> ok | {error, Reason::stanzaError()}
%% Item = mod_pubsub:pubsubItems() %% Item = mod_pubsub:pubsubItems()
%% @doc <p>Write a state into database.</p> %% @doc <p>Write a state into database.</p>
set_item(Item) when is_record(Item, pubsub_item) -> set_item(Item) when is_record(Item, pubsub_item) ->

View File

@ -58,7 +58,7 @@
%% API definition %% API definition
%% ================ %% ================
%% @spec (Host) -> any() %% @spec (Host, ServerHost, Opts) -> any()
%% Host = mod_pubsub:host() %% Host = mod_pubsub:host()
%% ServerHost = host() %% ServerHost = host()
%% Opts = list() %% Opts = list()

View File

@ -55,7 +55,7 @@
%% API definition %% API definition
%% ================ %% ================
%% @spec (Host) -> any() %% @spec (Host, ServerHost, Opts) -> any()
%% Host = mod_pubsub:host() %% Host = mod_pubsub:host()
%% ServerHost = host() %% ServerHost = host()
%% Opts = list() %% Opts = list()

View File

@ -16,7 +16,7 @@
%%% This software is copyright 2006-2008, Process-one. %%% This software is copyright 2006-2008, Process-one.
%%% %%%
%%% %%%
%%% @copyright 2006-2008 Process-one %%% copyright 2006-2008 Process-one
%%% %%%
%%% This file contains pubsub types definition. %%% This file contains pubsub types definition.
%%% ==================================================================== %%% ====================================================================
@ -122,7 +122,7 @@
%% @type pubsubPresence() = #pubsub_presence{ %% @type pubsubPresence() = #pubsub_presence{
%% key = {Host::host(), User::string(), Server::string()}, %% key = {Host::host(), User::string(), Server::string()},
%% presence = list(). %% presence = list()}.
%%% <p>This is the format of the <tt>published presence</tt> table. The type of the %%% <p>This is the format of the <tt>published presence</tt> table. The type of the
%%% table is: <tt>set</tt>,<tt>ram</tt>.</p> %%% table is: <tt>set</tt>,<tt>ram</tt>.</p>
-record(pubsub_presence, {key, -record(pubsub_presence, {key,