• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

processone / ejabberd / 1296

19 Jan 2026 11:25AM UTC coverage: 33.562% (+0.09%) from 33.468%
1296

push

github

badlop
mod_conversejs: Cosmetic change: sort paths alphabetically

0 of 4 new or added lines in 1 file covered. (0.0%)

11245 existing lines in 174 files now uncovered.

15580 of 46421 relevant lines covered (33.56%)

1074.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/src/mod_time.erl
1
%%%----------------------------------------------------------------------
2
%%% File    : mod_time.erl
3
%%% Author  : Alexey Shchepin <alexey@process-one.net>
4
%%% Purpose :
5
%%% Purpose :
6
%%% Created : 18 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
7
%%%
8
%%%
9
%%% ejabberd, Copyright (C) 2002-2026   ProcessOne
10
%%%
11
%%% This program is free software; you can redistribute it and/or
12
%%% modify it under the terms of the GNU General Public License as
13
%%% published by the Free Software Foundation; either version 2 of the
14
%%% License, or (at your option) any later version.
15
%%%
16
%%% This program is distributed in the hope that it will be useful,
17
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
18
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19
%%% General Public License for more details.
20
%%%
21
%%% You should have received a copy of the GNU General Public License along
22
%%% with this program; if not, write to the Free Software Foundation, Inc.,
23
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
%%%
25
%%%----------------------------------------------------------------------
26

27
-module(mod_time).
28

29
-author('alexey@process-one.net').
30

31
-protocol({xep, 202, '2.0', '2.1.0', "complete", ""}).
32

33
-behaviour(gen_mod).
34

35
-export([start/2, stop/1, reload/3, process_local_iq/1,
36
         mod_options/1, depends/2, mod_doc/0]).
37

38
-include("logger.hrl").
39
-include_lib("xmpp/include/xmpp.hrl").
40
-include("translate.hrl").
41

42
start(_Host, _Opts) ->
43
    {ok, [{iq_handler, ejabberd_local, ?NS_TIME, process_local_iq}]}.
99✔
44

45
stop(_Host) ->
46
    ok.
99✔
47

48
reload(_Host, _NewOpts, _OldOpts) ->
49
    ok.
×
50

51
-spec process_local_iq(iq()) -> iq().
52
process_local_iq(#iq{type = set, lang = Lang} = IQ) ->
53
    Txt = ?T("Value 'set' of 'type' attribute is not allowed"),
×
54
    xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang));
×
55
process_local_iq(#iq{type = get} = IQ) ->
UNCOV
56
    Now = os:timestamp(),
1✔
UNCOV
57
    Now_universal = calendar:now_to_universal_time(Now),
1✔
UNCOV
58
    Now_local = calendar:universal_time_to_local_time(Now_universal),
1✔
UNCOV
59
    Seconds_diff =
1✔
60
        calendar:datetime_to_gregorian_seconds(Now_local) -
61
        calendar:datetime_to_gregorian_seconds(Now_universal),
UNCOV
62
    {Hd, Md, _} = calendar:seconds_to_time(abs(Seconds_diff)),
1✔
UNCOV
63
    xmpp:make_iq_result(IQ, #time{tzo = {Hd, Md}, utc = Now}).
1✔
64

65
depends(_Host, _Opts) ->
66
    [].
117✔
67

68
mod_options(_Host) ->
69
    [].
117✔
70

71
mod_doc() ->
72
    #{desc =>
×
73
          ?T("This module adds support for "
74
             "https://xmpp.org/extensions/xep-0202.html"
75
             "[XEP-0202: Entity Time]. In other words, "
76
             "the module reports server's system time.")}.
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc