metajack/strophejs — Issue #77: attach() doesn't trigger a poll
Author: alexstrat
Created: 2012-01-27 10:34:51+00:00
State: open

I noticed that, when attaching to a session, if there is no activity (send stanza) Strophe never polls.. and the session expires after a while whereas I'm attaching..

When using `#connect`, Strophe polls at least every 60 seconds. When attaching, should we not have the same behavior ?

I don't know if this should be fixed but I think I have the fix, which is not hard. Actually, the `_onIdle` process is not triggered because we are disconnected, it shall be restarted by hand : In `#attach()`, `#_onIdle()` shall be called at the end.

```js
attach: function (jid, sid, rid, callback, wait, hold, wind)
{
//...
//Bla bala
//...

this._changeConnectStatus(Strophe.Status.ATTACHED, null);
this._onIdle();
},
```

I'll do a pull request if you find this relevant. Thanks.