{"action":"created","issue":{"url":"https://api.github.com/repos/strophe/strophejs/issues/304","repository_url":"https://api.github.com/repos/strophe/strophejs","labels_url":"https://api.github.com/repos/strophe/strophejs/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/strophe/strophejs/issues/304/comments","events_url":"https://api.github.com/repos/strophe/strophejs/issues/304/events","html_url":"https://github.com/strophe/strophejs/issues/304","id":342701591,"node_id":"MDU6SXNzdWUzNDI3MDE1OTE=","number":304,"title":"How to use \"attach\" in Stropejs ?","user":{"login":"pratik-aileensoul","id":38644515,"node_id":"MDQ6VXNlcjM4NjQ0NTE1","avatar_url":"https://avatars2.githubusercontent.com/u/38644515?v=4","gravatar_id":"","url":"https://api.github.com/users/pratik-aileensoul","html_url":"https://github.com/pratik-aileensoul","followers_url":"https://api.github.com/users/pratik-aileensoul/followers","following_url":"https://api.github.com/users/pratik-aileensoul/following{/other_user}","gists_url":"https://api.github.com/users/pratik-aileensoul/gists{/gist_id}","starred_url":"https://api.github.com/users/pratik-aileensoul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratik-aileensoul/subscriptions","organizations_url":"https://api.github.com/users/pratik-aileensoul/orgs","repos_url":"https://api.github.com/users/pratik-aileensoul/repos","events_url":"https://api.github.com/users/pratik-aileensoul/events{/privacy}","received_events_url":"https://api.github.com/users/pratik-aileensoul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-19T12:10:07Z","updated_at":"2018-07-19T12:21:30Z","closed_at":null,"author_association":"NONE","body":"How to use \"attach\" in Stropejs ?\r\n\r\n`$(document).bind('connect', function (ev, data) {\r\n   var conn = new Strophe.Connection('http://127.0.0.1:7070/http-bind/', {sync: true});\r\n    conn.flush();  \r\n    conn.disconnect();\r\n\r\n    if(rid == \"\" && sid == \"\")\r\n    {\r\n        conn.connect(data.jid, data.password, function (status) {        \r\n            rid = conn.rid;\r\n            sid = conn.sid;\r\n            // console.log(Strophe.Status);\r\n            if (status === Strophe.Status.CONNECTED) {\r\n                login_jid = data.jid;\r\n                set_rsid();\r\n                $(document).trigger('connected');\r\n            } else if (status === Strophe.Status.DISCONNECTED) {\r\n                $(document).trigger('disconnected');\r\n            }\r\n        });\r\n    }\r\n    else\r\n    {\r\n       conn.attach(data.jid, sid, parseInt(rid,10)+1, function (status) {\r\n            console.log(status);\r\n            $(document).trigger('connected');\r\n         },null);\r\n    }    \r\n\r\n    Gab.connection = conn;\r\n});`\r\n\r\nwhen first time comes on the page user will auto login with no issue but when user comes second times on this page it give error like image:\r\n![oferror](https://user-images.githubusercontent.com/38644515/42941559-c4be5e1a-8b7a-11e8-9748-278d0a6d7f39.jpg)\r\n"},"comment":{"url":"https://api.github.com/repos/strophe/strophejs/issues/comments/406257310","html_url":"https://github.com/strophe/strophejs/issues/304#issuecomment-406257310","issue_url":"https://api.github.com/repos/strophe/strophejs/issues/304","id":406257310,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjI1NzMxMA==","user":{"login":"sualko","id":2974196,"node_id":"MDQ6VXNlcjI5NzQxOTY=","avatar_url":"https://avatars3.githubusercontent.com/u/2974196?v=4","gravatar_id":"","url":"https://api.github.com/users/sualko","html_url":"https://github.com/sualko","followers_url":"https://api.github.com/users/sualko/followers","following_url":"https://api.github.com/users/sualko/following{/other_user}","gists_url":"https://api.github.com/users/sualko/gists{/gist_id}","starred_url":"https://api.github.com/users/sualko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sualko/subscriptions","organizations_url":"https://api.github.com/users/sualko/orgs","repos_url":"https://api.github.com/users/sualko/repos","events_url":"https://api.github.com/users/sualko/events{/privacy}","received_events_url":"https://api.github.com/users/sualko/received_events","type":"User","site_admin":false},"created_at":"2018-07-19T12:21:29Z","updated_at":"2018-07-19T12:21:29Z","author_association":"MEMBER","body":"Is this the follow up from #302? Maybe http://strophe.im/strophejs/doc/1.2.15/files/strophe-js.html#Strophe.Connection.restore is interesting for you. As a general advice, if you like to get help from people who do this in there free time, please take time to format your issue accordingly."}}
{"actor":{"display_login":"sualko"}}