~ubuntu-branches/ubuntu/utopic/ejabberd/utopic

« back to all changes in this revision

Viewing changes to src/mod_pubsub/mod_pubsub_odbc.erl

  • Committer: Bazaar Package Importer
  • Author(s): Konstantin Khomoutov, Konstantin Khomoutov
  • Date: 2011-10-03 20:27:12 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20111003202712-w9071rc7vleldxwx
Tags: 2.1.9-1
[ Konstantin Khomoutov ]
* New upstream release.
* Remove obsoleted version.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1877
1877
            NodeId = TNode#pubsub_node.id,
1878
1878
            Type = TNode#pubsub_node.type,
1879
1879
            Options = TNode#pubsub_node.options,
1880
 
            BroadcastPayload = case Broadcast of
1881
 
                default -> Payload;
1882
 
                broadcast -> Payload;
1883
 
                PluginPayload -> PluginPayload
1884
 
            end,
1885
 
            broadcast_publish_item(Host, Node, NodeId, Type, Options, Removed, ItemId, jlib:jid_tolower(Publisher), BroadcastPayload),
 
1880
            case get_option(Options, deliver_notifications) of
 
1881
                        true ->
 
1882
                                BroadcastPayload = case Broadcast of
 
1883
                                        default -> Payload;
 
1884
                                        broadcast -> Payload;
 
1885
                                        PluginPayload -> PluginPayload
 
1886
                                end,
 
1887
                                broadcast_publish_item(Host, Node, NodeId, Type, Options,
 
1888
                                        Removed, ItemId, jlib:jid_tolower(Publisher),
 
1889
                                        BroadcastPayload);
 
1890
                        false ->
 
1891
                                ok
 
1892
                end,
1886
1893
            set_cached_item(Host, NodeId, ItemId, Publisher, Payload),
1887
1894
            case Result of
1888
1895
                default -> {result, Reply};
1914
1921
            case lists:member("auto-create", features(Type)) of
1915
1922
                true ->
1916
1923
                    case create_node(Host, ServerHost, Node, Publisher, Type) of
1917
 
                        {result, _} ->
1918
 
                            publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload);
 
1924
                        {result, [{xmlelement, "pubsub", [{"xmlns", ?NS_PUBSUB}],
 
1925
                          [{xmlelement, "create", [{"node", NewNode}], []}]}]} ->
 
1926
                            publish_item(Host, ServerHost,  list_to_binary(NewNode),
 
1927
                                    Publisher, ItemId, Payload);
1919
1928
                        _ ->
1920
1929
                            {error, ?ERR_ITEM_NOT_FOUND}
1921
1930
                    end;