Skip to content

Instantly share code, notes, and snippets.

@andrewvmail
Created March 1, 2016 23:26
Show Gist options
  • Save andrewvmail/de06ab436b39895ce025 to your computer and use it in GitHub Desktop.
Save andrewvmail/de06ab436b39895ce025 to your computer and use it in GitHub Desktop.
-spec room_jid_to_subject(RoomJID :: ejabberd:jid()) -> {ok, pid()} | {error, not_found}.
room_jid_to_subject(#jid{luser=RoomName, lserver=MucService}) ->
case mnesia:dirty_read(muc_online_room, {RoomName, MucService}) of
[R] ->
{ok, R#muc_online_room.name_host};
[] ->
{error, not_found}
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment