Its possible theres another IQ handler elsewhere in the code but, that
seems really unlikely. For those of you that know Erlang, see below.

process_local_iq(_From, _To, #iq{type = Type, sub_el = SubEl} = IQ) ->
    case Type of
set ->
    IQ#iq{type = error, sub_el = [SubEl, ?ERR_NOT_ALLOWED]};
get ->
    Now = now(),
    Now_universal = calendar:now_to_universal_time(Now),
    Now_local = calendar:now_to_local_time(Now),
    {UTC, UTC_diff} = jlib:timestamp_to_iso(Now_universal, utc),
    Seconds_diff = calendar:datetime_to_gregorian_seconds(Now_local)
     - calendar:datetime_to_gregorian_seconds(Now_universal),
    {Hd, Md, _} = calendar:seconds_to_time(abs(Seconds_diff)),
    {_, TZO_diff} = jlib:timestamp_to_iso({{0, 0, 0}, {0, 0, 0}},
{sign(Seconds_diff), {Hd, Md}}),
    IQ#iq{type = result,
  sub_el = [{xmlelement, "time",
     [{"xmlns", ?NS_TIME}],
     [{xmlelement, "tzo", [],
       [{xmlcdata, TZO_diff}]},
      {xmlelement, "utc", [],
       [{xmlcdata, UTC ++ UTC_diff}]}]}]}
    end.



On Wed, May 22, 2013 at 8:25 AM, Sergey Dobrov <[email protected]> wrote:

> On 05/22/2013 07:22 PM, Ralph Meijer wrote:
> > Version 2.1.12 ignores to in the IQ
> It sounds like smth impossible. I use ejabberd and iq:time works just
> fine when addressing stanza appropriately.
>
> --
> With best regards,
> Sergey Dobrov,
> XMPP Developer and JRuDevels.org founder.
>



-- 
Noah

Reply via email to