From 693e32aecf88170f4ddac2e66b8f1387c5825f90 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 26 Nov 2008 16:04:27 +0000 Subject: [PATCH] * src/mod_irc/mod_irc.erl: Announce disco#info (thanks to Spike) * src/mod_muc/mod_muc.erl: Announce disco#info disco#items * src/mod_proxy65/mod_proxy65_service.erl: No announce disco#items * src/mod_pubsub/mod_pubsub.erl: Announce disco#info disco#items * src/mod_vcard.erl: Announce disco#info SVN Revision: 1686 --- ChangeLog | 6 ++++++ src/mod_irc/mod_irc.erl | 10 ++++------ src/mod_muc/mod_muc.erl | 2 ++ src/mod_proxy65/mod_proxy65_service.erl | 1 - src/mod_pubsub/mod_pubsub.erl | 2 ++ src/mod_vcard.erl | 6 ++++-- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 002fe4014..b0c2c1012 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-11-26 Badlop + * src/mod_irc/mod_irc.erl: Announce disco#info (thanks to Spike) + * src/mod_muc/mod_muc.erl: Announce disco#info disco#items + * src/mod_proxy65/mod_proxy65_service.erl: No announce disco#items + * src/mod_pubsub/mod_pubsub.erl: Announce disco#info disco#items + * src/mod_vcard.erl: Announce disco#info + * src/gen_mod.erl: First store module options in ETS and Mnesia, then start the module. In case of failure, remove options from ETS. Until now the module was started before the options were diff --git a/src/mod_irc/mod_irc.erl b/src/mod_irc/mod_irc.erl index dd86037b9..dedd4f778 100644 --- a/src/mod_irc/mod_irc.erl +++ b/src/mod_irc/mod_irc.erl @@ -309,12 +309,10 @@ iq_disco(Lang) -> [{"category", "conference"}, {"type", "irc"}, {"name", translate:translate(Lang, "IRC Transport")}], []}, - {xmlelement, "feature", - [{"var", ?NS_MUC}], []}, - {xmlelement, "feature", - [{"var", ?NS_REGISTER}], []}, - {xmlelement, "feature", - [{"var", ?NS_VCARD}], []}]. + {xmlelement, "feature", [{"var", ?NS_DISCO_INFO}], []}, + {xmlelement, "feature", [{"var", ?NS_MUC}], []}, + {xmlelement, "feature", [{"var", ?NS_REGISTER}], []}, + {xmlelement, "feature", [{"var", ?NS_VCARD}], []}]. iq_get_vcard(Lang) -> [{xmlelement, "FN", [], diff --git a/src/mod_muc/mod_muc.erl b/src/mod_muc/mod_muc.erl index 812c8de97..880540bef 100644 --- a/src/mod_muc/mod_muc.erl +++ b/src/mod_muc/mod_muc.erl @@ -508,6 +508,8 @@ iq_disco_info(Lang) -> [{"category", "conference"}, {"type", "text"}, {"name", translate:translate(Lang, "Chatrooms")}], []}, + {xmlelement, "feature", [{"var", ?NS_DISCO_INFO}], []}, + {xmlelement, "feature", [{"var", ?NS_DISCO_ITEMS}], []}, {xmlelement, "feature", [{"var", ?NS_MUC}], []}, {xmlelement, "feature", [{"var", ?NS_REGISTER}], []}, {xmlelement, "feature", [{"var", ?NS_VCARD}], []}]. diff --git a/src/mod_proxy65/mod_proxy65_service.erl b/src/mod_proxy65/mod_proxy65_service.erl index 3eba270a6..ecf838295 100644 --- a/src/mod_proxy65/mod_proxy65_service.erl +++ b/src/mod_proxy65/mod_proxy65_service.erl @@ -179,7 +179,6 @@ iq_disco_info(Lang, Name) -> {"type", "bytestreams"}, {"name", translate:translate(Lang, Name)}], []}, ?FEATURE(?NS_DISCO_INFO), - ?FEATURE(?NS_DISCO_ITEMS), ?FEATURE(?NS_VCARD), ?FEATURE(?NS_BYTESTREAMS)]. diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index 7e4d26420..f69fa4b85 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -755,6 +755,8 @@ iq_disco_info(Host, SNode, From, Lang) -> [{"category", "pubsub"}, {"type", "service"}, {"name", translate:translate(Lang, "Publish-Subscribe")}], []}, + {xmlelement, "feature", [{"var", ?NS_DISCO_INFO}], []}, + {xmlelement, "feature", [{"var", ?NS_DISCO_ITEMS}], []}, {xmlelement, "feature", [{"var", ?NS_PUBSUB}], []}, {xmlelement, "feature", [{"var", ?NS_VCARD}], []}] ++ lists:map(fun(Feature) -> diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 004a238d1..c2c00b954 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -138,9 +138,9 @@ get_sm_features(Acc, _From, _To, Node, _Lang) -> [] -> case Acc of {result, Features} -> - {result, [?NS_VCARD | Features]}; + {result, [?NS_DISCO_INFO, ?NS_VCARD | Features]}; empty -> - {result, [?NS_VCARD]} + {result, [?NS_DISCO_INFO, ?NS_VCARD]} end; _ -> Acc @@ -378,6 +378,8 @@ do_route(ServerHost, From, To, Packet) -> {"name", translate:translate(Lang, "vCard User Search")}], []}, + {xmlelement, "feature", + [{"var", ?NS_DISCO_INFO}], []}, {xmlelement, "feature", [{"var", ?NS_SEARCH}], []}, {xmlelement, "feature",