mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +01:00
Don't resend badge if there are no offline messages
This commit is contained in:
parent
0d8aacb3e7
commit
2aea503a2a
@ -251,7 +251,11 @@ resend_badge(To) ->
|
||||
Host,
|
||||
0,
|
||||
[To#jid.luser, Host]),
|
||||
Badge = integer_to_list(Offline + 1),
|
||||
if
|
||||
Offline == 0 ->
|
||||
ok;
|
||||
true ->
|
||||
Badge = integer_to_list(Offline),
|
||||
DeviceID = erlang:integer_to_list(ID, 16),
|
||||
Packet1 =
|
||||
{xmlelement, "message", [],
|
||||
@ -261,6 +265,7 @@ resend_badge(To) ->
|
||||
{xmlelement, "badge", [],
|
||||
[{xmlcdata, Badge}]}]}]},
|
||||
ejabberd_router:route(To, ServiceJID, Packet1)
|
||||
end
|
||||
end;
|
||||
false ->
|
||||
{error, "mod_applepush is not loaded"}
|
||||
|
Loading…
Reference in New Issue
Block a user