diff --git a/mod_webpresence/src/mod_webpresence.erl b/mod_webpresence/src/mod_webpresence.erl index 0251341..7a58013 100644 --- a/mod_webpresence/src/mod_webpresence.erl +++ b/mod_webpresence/src/mod_webpresence.erl @@ -573,10 +573,15 @@ get_status_weight(Show) -> session_to_presence(#session{sid = {_, Pid}}) -> P = ejabberd_c2s:get_presence(Pid), #presence2{resource = (P#presence.from)#jid.resource, - show = misc:atom_to_binary(P#presence.show), + show = misc:atom_to_binary(humanize_show(P#presence.show)), priority = P#presence.priority, status = xmpp:get_text(P#presence.status)}. +humanize_show(undefined) -> + available; +humanize_show(Show) -> + Show. + get_presences({bare, LUser, LServer}) -> [session_to_presence(Session) || Session <- mnesia:dirty_index_read(session, {LUser, LServer}, #session.us)];