{"action":"created","issue":{"url":"https://api.github.com/repos/processone/ejabberd/issues/1384","repository_url":"https://api.github.com/repos/processone/ejabberd","labels_url":"https://api.github.com/repos/processone/ejabberd/issues/1384/labels{/name}","comments_url":"https://api.github.com/repos/processone/ejabberd/issues/1384/comments","events_url":"https://api.github.com/repos/processone/ejabberd/issues/1384/events","html_url":"https://github.com/processone/ejabberd/issues/1384","id":190247346,"number":1384,"title":"Getting Room Name or Subject From Muc Hooks","user":{"login":"tolgatanriverdi","id":1306155,"avatar_url":"https://avatars.githubusercontent.com/u/1306155?v=3","gravatar_id":"","url":"https://api.github.com/users/tolgatanriverdi","html_url":"https://github.com/tolgatanriverdi","followers_url":"https://api.github.com/users/tolgatanriverdi/followers","following_url":"https://api.github.com/users/tolgatanriverdi/following{/other_user}","gists_url":"https://api.github.com/users/tolgatanriverdi/gists{/gist_id}","starred_url":"https://api.github.com/users/tolgatanriverdi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolgatanriverdi/subscriptions","organizations_url":"https://api.github.com/users/tolgatanriverdi/orgs","repos_url":"https://api.github.com/users/tolgatanriverdi/repos","events_url":"https://api.github.com/users/tolgatanriverdi/events{/privacy}","received_events_url":"https://api.github.com/users/tolgatanriverdi/received_events","type":"User","site_admin":false},"labels":[{"id":352233730,"url":"https://api.github.com/repos/processone/ejabberd/labels/Kind:Question","name":"Kind:Question","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"badlop","id":96807,"avatar_url":"https://avatars.githubusercontent.com/u/96807?v=3","gravatar_id":"","url":"https://api.github.com/users/badlop","html_url":"https://github.com/badlop","followers_url":"https://api.github.com/users/badlop/followers","following_url":"https://api.github.com/users/badlop/following{/other_user}","gists_url":"https://api.github.com/users/badlop/gists{/gist_id}","starred_url":"https://api.github.com/users/badlop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badlop/subscriptions","organizations_url":"https://api.github.com/users/badlop/orgs","repos_url":"https://api.github.com/users/badlop/repos","events_url":"https://api.github.com/users/badlop/events{/privacy}","received_events_url":"https://api.github.com/users/badlop/received_events","type":"User","site_admin":false},"assignees":[{"login":"badlop","id":96807,"avatar_url":"https://avatars.githubusercontent.com/u/96807?v=3","gravatar_id":"","url":"https://api.github.com/users/badlop","html_url":"https://github.com/badlop","followers_url":"https://api.github.com/users/badlop/followers","following_url":"https://api.github.com/users/badlop/following{/other_user}","gists_url":"https://api.github.com/users/badlop/gists{/gist_id}","starred_url":"https://api.github.com/users/badlop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badlop/subscriptions","organizations_url":"https://api.github.com/users/badlop/orgs","repos_url":"https://api.github.com/users/badlop/repos","events_url":"https://api.github.com/users/badlop/events{/privacy}","received_events_url":"https://api.github.com/users/badlop/received_events","type":"User","site_admin":false}],"milestone":null,"comments":16,"created_at":"2016-11-18T06:40:13Z","updated_at":"2016-12-13T07:56:53Z","closed_at":null,"body":"I want to get the room's name or subject from one of the ejabberd hooks.\r\nI've a method like in the below code and I want to get room's name or subject within that method.\r\nIs something like that possible?\r\n\r\n    muc_filter_message(Stanza, MUCState, RoomJID, FromJID, FromNick) ->\r\n        PostUrl = gen_mod:get_module_opt(FromJID#jid.lserver, ?MODULE, post_url, fun(S) -> iolist_to_binary(S) end, list_to_binary(\"\")),\r\n        Token = gen_mod:get_module_opt(FromJID#jid.lserver, ?MODULE, auth_token, fun(S) -> iolist_to_binary(S) end, list_to_binary(\"\")),\r\n        Body = fxml:get_path_s(Stanza, [{elem, list_to_binary(\"body\")}, cdata]),\r\n    \r\n        _LISTUSERS = lists:map(\r\n            fun({_LJID, Info}) ->\r\n                binary_to_list(Info#user.jid#jid.luser) ++ \"..\"\r\n            end,\r\n            dict:to_list(MUCState#state.users)\r\n        ),\r\n        ?DEBUG(\" #########    GROUPCHAT _LISTUSERS = ~p~n  #######   \", [_LISTUSERS]),\r\n    \r\n        _AFILLIATIONS = lists:map(\r\n            fun({{Uname, _Domain, _Res}, _Stuff}) ->\r\n                binary_to_list(Uname) ++ \"..\"\r\n            end,\r\n            dict:to_list(MUCState#state.affiliations)\r\n        ),\r\n        ?DEBUG(\" #########    GROUPCHAT _AFILLIATIONS = ~p~n  #######   \", [_AFILLIATIONS]),\r\n    \r\n        _OFFLINE = lists:subtract(_AFILLIATIONS, _LISTUSERS),\r\n        ?DEBUG(\" #########    GROUPCHAT _OFFLINE = ~p~n  #######   \", [_OFFLINE]),\r\n    \r\n        if\r\n            Stanza /= \"\", length(_OFFLINE) > 0 ->\r\n                Sep = \"&\",\r\n                Post = [\r\n                    \"type=groupchat\", Sep,\r\n                    \"to=\", RoomJID#jid.luser, Sep,\r\n                    \"from=\", FromJID#jid.luser, Sep,\r\n                    \"offline=\", _OFFLINE, Sep,\r\n                    \"nick=\", FromNick, Sep,\r\n                    \"body=\", url_encode(binary_to_list(Body)), Sep,\r\n                    \"access_token=\", Token\r\n                ],\r\n                ?INFO_MSG(\"Sending post request to ~s with body \\\"~s\\\"\", [PostUrl, Post]),\r\n                httpc:request(post, {binary_to_list(PostUrl), [], \"application/x-www-form-urlencoded\", list_to_binary(Post)},[],[]),\r\n                Stanza;\r\n            true ->\r\n                Stanza\r\n        end.\r\n\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/processone/ejabberd/issues/comments/266670950","html_url":"https://github.com/processone/ejabberd/issues/1384#issuecomment-266670950","issue_url":"https://api.github.com/repos/processone/ejabberd/issues/1384","id":266670950,"user":{"login":"tolgatanriverdi","id":1306155,"avatar_url":"https://avatars.githubusercontent.com/u/1306155?v=3","gravatar_id":"","url":"https://api.github.com/users/tolgatanriverdi","html_url":"https://github.com/tolgatanriverdi","followers_url":"https://api.github.com/users/tolgatanriverdi/followers","following_url":"https://api.github.com/users/tolgatanriverdi/following{/other_user}","gists_url":"https://api.github.com/users/tolgatanriverdi/gists{/gist_id}","starred_url":"https://api.github.com/users/tolgatanriverdi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolgatanriverdi/subscriptions","organizations_url":"https://api.github.com/users/tolgatanriverdi/orgs","repos_url":"https://api.github.com/users/tolgatanriverdi/repos","events_url":"https://api.github.com/users/tolgatanriverdi/events{/privacy}","received_events_url":"https://api.github.com/users/tolgatanriverdi/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T07:56:53Z","updated_at":"2016-12-13T07:56:53Z","body":"I've installed 16.12 beta 1 version and the result is still the same:\r\n\r\nUser-1 of the group de-member himself with using\r\n<iq type='set' to='sala1@conference.localhost' id='1232312312'>\r\n  <query xmlns='http://jabber.org/protocol/muc#admin'>\r\n    <item nick='user2' affiliation='none'/>\r\n  </query>\r\n</iq>\r\nUser-2 of the group never receives a message about the user-1 action"}}
{"actor":{"display_login":"tolgatanriverdi"}}