librelist archives

« back to archive

Feature : On login ignore old room join requests

Feature : On login ignore old room join requests

From:
Gauri Padbidri
Date:
2015-03-18 @ 17:05
Hi JC,

I have modified code to create Private Chat Rooms programatically. However,
when I have sent out the invite to users and the room does not exist
anymore, the user still gets notifications. Following is my test case :

1.	Login as "User A"
2.	Click some icon that opens the autocomplete text filed, which helps
inviting users to join ChatRoom.
3.	Send invites to "User B", "User C" and "User D".
4.	Assuming the invite is accepted by "User B" and "User C". So now
ChatRoom participants are : User A, User B, User C.
5.	Consider that ALL users leave the ChatRoom. (Meaning the Chat Room
does not exist as there are no participants)
6.	Now "User D" logs in and he gets the invitation, but the room does
not exist.

Result : I want to DISABLE the feature of users getting "chatroom invites"
immideately after login....Where in the Converse JS is the code that
displays ALL the queued offline messages / invites, etc...Please let me know
the API that is responsible for displaying users with invites immideately
after login.

Best Regards,
Gauri Padbidri

 

Re: [conversejs] Feature : On login ignore old room join requests

From:
Jc Brand
Date:
2015-03-20 @ 08:50
Hi Guari

On Wed, Mar 18, 2015 at 10:35:56PM +0530, Gauri Padbidri wrote:
>    I have modified code to create Private Chat Rooms programatically.
>    However, when I have sent out the invite to users and the room does not
>    exist anymore, the user still gets notifications. Following is my test
>    case :
> 
>     1. Login as "User A"
>     2. Click some icon that opens the autocomplete text filed, which helps
>        inviting users to join ChatRoom.
>     3. Send invites to "User B", "User C" and "User D".
>     4. Assuming the invite is accepted by "User B" and "User C". So now
>        ChatRo om participants are : User A, User B, User C.
>     5. Consider that ALL users leave the ChatRoom. (Meaning the Chat Room
>        does not exist as there are no participants)
>     6. Now "User D" logs in and he gets the invitation, but the room does not
>        exist.
> 
>    Result : I want to DISABLE the feature of users getting "chatroom i
>    nvites" immideately after login....Where in the Converse JS is the code
>    that displays ALL the queued offline messages / invites, etc...Please let
>    me know the API that is responsible for displaying users with invites
>    immideately after login.

They way I would approach this would be to write a plugin for converse.js which
overrides the onInvite handler.

That handler is registered here:

https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527dd89f08c2f61f11/converse.js#L2997

And the definition is here:

https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527dd89f08c2f61f11/converse.js#L2997

You'll want to put a check in that method to see whether the chat room exists
before continuing.

JC

Re: [conversejs] Feature : On login ignore old room join requests

From:
Gauri Padbidri
Date:
2015-03-23 @ 12:37
Hi JC,

Can you help me identify the API that helps me checks the existence of a 
Chat Room ? Thanks !

-----Original Message-----
From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com] 
Sent: Saturday, March 21, 2015 1:10 AM
To: 'conversejs@librelist.com'
Subject: RE: [conversejs] Feature : On login ignore old room join requests

Hey JC, 

Thanks for your help ! Can you please tell me how I can check the 
existence of a Chat Room ? How do I check if the Chat Room exists or not ?

Best Regards,
Gauri Padbidri

-----Original Message-----
From: conversejs@librelist.com [mailto:conversejs@librelist.com] On Behalf
Of JC Brand
Sent: Friday, March 20, 2015 2:20 PM
To: conversejs@librelist.com
Subject: Re: [conversejs] Feature : On login ignore old room join requests

Hi Guari

On Wed, Mar 18, 2015 at 10:35:56PM +0530, Gauri Padbidri wrote:
>    I have modified code to create Private Chat Rooms programatically.
>    However, when I have sent out the invite to users and the room does not
>    exist anymore, the user still gets notifications. Following is my test
>    case :
> 
>     1. Login as "User A"
>     2. Click some icon that opens the autocomplete text filed, which helps
>        inviting users to join ChatRoom.
>     3. Send invites to "User B", "User C" and "User D".
>     4. Assuming the invite is accepted by "User B" and "User C". So now
>        ChatRo om participants are : User A, User B, User C.
>     5. Consider that ALL users leave the ChatRoom. (Meaning the Chat Room
>        does not exist as there are no participants)
>     6. Now "User D" logs in and he gets the invitation, but the room does not
>        exist.
> 
>    Result : I want to DISABLE the feature of users getting "chatroom i
>    nvites" immideately after login....Where in the Converse JS is the code
>    that displays ALL the queued offline messages / invites, etc...Please let
>    me know the API that is responsible for displaying users with invites
>    immideately after login.

They way I would approach this would be to write a plugin for converse.js 
which overrides the onInvite handler.

That handler is registered here:

https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527dd89f08c2f61f11/converse.js#L2997

And the definition is here:

https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527dd89f08c2f61f11/converse.js#L2997

You'll want to put a check in that method to see whether the chat room 
exists before continuing.

JC

Re: [conversejs] Feature : On login ignore old room join requests

From:
Jc Brand
Date:
2015-03-25 @ 11:31
On Mon, Mar 23, 2015 at 06:07:15PM +0530, Gauri Padbidri wrote:
> Hi JC,
> 
> Can you help me identify the API that helps me checks the existence of a
Chat Room ? Thanks !

Hi Gauri

The closest thing to that in converse.js is the showRooms method:


https://github.com/jcbrand/converse.js/blob/8469bf0a0d99ff8f14e6c64a9829100ee71dbdd6/converse.js#L1848

I'm not sure if there is a way to search for a particular room in XMPP, you'll
have to read XEP-45 and do some searching to find out.

Regards
JC



> -----Original Message-----
> From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com] 
> Sent: Saturday, March 21, 2015 1:10 AM
> To: 'conversejs@librelist.com'
> Subject: RE: [conversejs] Feature : On login ignore old room join requests
> 
> Hey JC, 
> 
> Thanks for your help ! Can you please tell me how I can check the 
existence of a Chat Room ? How do I check if the Chat Room exists or not ?
> 
> Best Regards,
> Gauri Padbidri
> 
> -----Original Message-----
> From: conversejs@librelist.com [mailto:conversejs@librelist.com] On 
Behalf Of JC Brand
> Sent: Friday, March 20, 2015 2:20 PM
> To: conversejs@librelist.com
> Subject: Re: [conversejs] Feature : On login ignore old room join requests
> 
> Hi Guari
> 
> On Wed, Mar 18, 2015 at 10:35:56PM +0530, Gauri Padbidri wrote:
> >    I have modified code to create Private Chat Rooms programatically.
> >    However, when I have sent out the invite to users and the room does not
> >    exist anymore, the user still gets notifications. Following is my test
> >    case :
> > 
> >     1. Login as "User A"
> >     2. Click some icon that opens the autocomplete text filed, which helps
> >        inviting users to join ChatRoom.
> >     3. Send invites to "User B", "User C" and "User D".
> >     4. Assuming the invite is accepted by "User B" and "User C". So now
> >        ChatRo om participants are : User A, User B, User C.
> >     5. Consider that ALL users leave the ChatRoom. (Meaning the Chat Room
> >        does not exist as there are no participants)
> >     6. Now "User D" logs in and he gets the invitation, but the room does not
> >        exist.
> > 
> >    Result : I want to DISABLE the feature of users getting "chatroom i
> >    nvites" immideately after login....Where in the Converse JS is the code
> >    that displays ALL the queued offline messages / invites, etc...Please let
> >    me know the API that is responsible for displaying users with invites
> >    immideately after login.
> 
> They way I would approach this would be to write a plugin for 
converse.js which overrides the onInvite handler.
> 
> That handler is registered here:
> 
https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527dd89f08c2f61f11/converse.js#L2997
> 
> And the definition is here:
> 
https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527dd89f08c2f61f11/converse.js#L2997
> 
> You'll want to put a check in that method to see whether the chat room 
exists before continuing.
> 
> JC
> 

Re: [conversejs] Feature : On login ignore old room join requests

From:
Gauri Padbidri
Date:
2015-03-31 @ 14:04
Hi JC,

	I resolved this issue by registering to the :
	converse.connection.addHandler(
                    $.proxy(function (message) {
                        // Set some Javascript FLAG and Check for this FLAG
in the onInvite() API.
                        return true;
                    }, this), 'jabber:x:delay', 'message');


Best Regards,
Gauri Padbidri

-----Original Message-----
From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com] 
Sent: Thursday, March 26, 2015 7:51 PM
To: 'conversejs@librelist.com'
Subject: RE: [conversejs] Feature : On login ignore old room join requests

Hi JC,

Tweaking a little bit using Fiddler, I found that when a user already has
OFFLINE Chat Room Invites in his queue, and he logs in, he gets all the
pending invite requests. When I observed the Fiddler response, as to how the
OFFLINE Chat Room Invites come,  I see the following output in Fiddler,
which is interesting (as it tags ALL Invites as "Offline Storage") : 

<message xmlns='jabber:client'
from='gauri@someDomain.com/converse.js-100245555' to='deepak@
someDomain.com' id='30'>
	<x xmlns='jabber:x:conference' jid='nilesh,deepak@lobby.
someDomain.com' reason='Join the Private Group Chat'/>
	<delay xmlns='urn:xmpp:delay' from=' someDomain.com'
stamp='2015-03-26T13:49:36Z'>Offline Storage</delay>
	<x xmlns='jabber:x:delay' stamp='20150326T13:49:36'/> </message>

Also, when the onInvite() Event is invoked, it is bound as follows : 
converse.connection.addHandler(
                    $.proxy(function (message) {
                        this.onInvite(message);
                        return true;
                    }, this), 'jabber:x:conference', 'message');

However, the onInvite(message) does NOT receive the ENTIRE Message Node.
However, if I get the entire Message Node I can see if it is "Offline
Storage" and avoid offline Chat Room invites...How can I do that ? Where is
the filter that only makes the following available as "message" : 

<message xmlns='jabber:client' from='gauri@
someDomain.com/converse.js-100244592' to='deepak@ someDomain.com' id='30'>
	<x xmlns='jabber:x:conference' jid='nilesh,deepak@lobby.
someDomain.com' reason='Join the Private Group Chat'/> </message>

I need a way where I get the ENTIRE Message Node in the onInvite() API.
Please help me on this one as I have my release in a couple of days :(
Thanks ! 

Best Regards,
Gauri Padbidri

-----Original Message-----
From: conversejs@librelist.com [mailto:conversejs@librelist.com] On Behalf
Of JC Brand
Sent: Wednesday, March 25, 2015 5:02 PM
To: conversejs@librelist.com
Subject: Re: [conversejs] Feature : On login ignore old room join requests

On Mon, Mar 23, 2015 at 06:07:15PM +0530, Gauri Padbidri wrote:
> Hi JC,
> 
> Can you help me identify the API that helps me checks the existence of a
Chat Room ? Thanks !

Hi Gauri

The closest thing to that in converse.js is the showRooms method:

https://github.com/jcbrand/converse.js/blob/8469bf0a0d99ff8f14e6c64a9829100e
e71dbdd6/converse.js#L1848

I'm not sure if there is a way to search for a particular room in XMPP,
you'll have to read XEP-45 and do some searching to find out.

Regards
JC



> -----Original Message-----
> From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com]
> Sent: Saturday, March 21, 2015 1:10 AM
> To: 'conversejs@librelist.com'
> Subject: RE: [conversejs] Feature : On login ignore old room join 
> requests
> 
> Hey JC,
> 
> Thanks for your help ! Can you please tell me how I can check the
existence of a Chat Room ? How do I check if the Chat Room exists or not ?
> 
> Best Regards,
> Gauri Padbidri
> 
> -----Original Message-----
> From: conversejs@librelist.com [mailto:conversejs@librelist.com] On 
> Behalf Of JC Brand
> Sent: Friday, March 20, 2015 2:20 PM
> To: conversejs@librelist.com
> Subject: Re: [conversejs] Feature : On login ignore old room join 
> requests
> 
> Hi Guari
> 
> On Wed, Mar 18, 2015 at 10:35:56PM +0530, Gauri Padbidri wrote:
> >    I have modified code to create Private Chat Rooms programatically.
> >    However, when I have sent out the invite to users and the room does
not
> >    exist anymore, the user still gets notifications. Following is my
test
> >    case :
> > 
> >     1. Login as "User A"
> >     2. Click some icon that opens the autocomplete text filed, which
helps
> >        inviting users to join ChatRoom.
> >     3. Send invites to "User B", "User C" and "User D".
> >     4. Assuming the invite is accepted by "User B" and "User C". So now
> >        ChatRo om participants are : User A, User B, User C.
> >     5. Consider that ALL users leave the ChatRoom. (Meaning the Chat
Room
> >        does not exist as there are no participants)
> >     6. Now "User D" logs in and he gets the invitation, but the room
does not
> >        exist.
> > 
> >    Result : I want to DISABLE the feature of users getting "chatroom i
> >    nvites" immideately after login....Where in the Converse JS is the
code
> >    that displays ALL the queued offline messages / invites, etc...Please
let
> >    me know the API that is responsible for displaying users with invites
> >    immideately after login.
> 
> They way I would approach this would be to write a plugin for converse.js
which overrides the onInvite handler.
> 
> That handler is registered here:
> https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527d
> d89f08c2f61f11/converse.js#L2997
> 
> And the definition is here:
> https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527d
> d89f08c2f61f11/converse.js#L2997
> 
> You'll want to put a check in that method to see whether the chat room
exists before continuing.
> 
> JC
> 

Re: [conversejs] Feature : On login ignore old room join requests

From:
Jc Brand
Date:
2015-03-31 @ 14:53
Hi Gauri

Glad you got it to work, thanks for sharing.

JC

On Tue, Mar 31, 2015 at 07:34:10PM +0530, Gauri Padbidri wrote:
> Hi JC,
> 
> 	I resolved this issue by registering to the :
> 	converse.connection.addHandler(
>                     $.proxy(function (message) {
>                         // Set some Javascript FLAG and Check for this 
FLAG in the onInvite() API.
>                         return true;
>                     }, this), 'jabber:x:delay', 'message');
> 
> 
> Best Regards,
> Gauri Padbidri
> 
> -----Original Message-----
> From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com] 
> Sent: Thursday, March 26, 2015 7:51 PM
> To: 'conversejs@librelist.com'
> Subject: RE: [conversejs] Feature : On login ignore old room join requests
> 
> Hi JC,
> 
> Tweaking a little bit using Fiddler, I found that when a user already has
> OFFLINE Chat Room Invites in his queue, and he logs in, he gets all the
> pending invite requests. When I observed the Fiddler response, as to how the
> OFFLINE Chat Room Invites come,  I see the following output in Fiddler,
> which is interesting (as it tags ALL Invites as "Offline Storage") : 
> 
> <message xmlns='jabber:client'
> from='gauri@someDomain.com/converse.js-100245555' to='deepak@
> someDomain.com' id='30'>
> 	<x xmlns='jabber:x:conference' jid='nilesh,deepak@lobby.
> someDomain.com' reason='Join the Private Group Chat'/>
> 	<delay xmlns='urn:xmpp:delay' from=' someDomain.com'
> stamp='2015-03-26T13:49:36Z'>Offline Storage</delay>
> 	<x xmlns='jabber:x:delay' stamp='20150326T13:49:36'/> </message>
> 
> Also, when the onInvite() Event is invoked, it is bound as follows : 
> converse.connection.addHandler(
>                     $.proxy(function (message) {
>                         this.onInvite(message);
>                         return true;
>                     }, this), 'jabber:x:conference', 'message');
> 
> However, the onInvite(message) does NOT receive the ENTIRE Message Node.
> However, if I get the entire Message Node I can see if it is "Offline
> Storage" and avoid offline Chat Room invites...How can I do that ? Where is
> the filter that only makes the following available as "message" : 
> 
> <message xmlns='jabber:client' from='gauri@
> someDomain.com/converse.js-100244592' to='deepak@ someDomain.com' id='30'>
> 	<x xmlns='jabber:x:conference' jid='nilesh,deepak@lobby.
> someDomain.com' reason='Join the Private Group Chat'/> </message>
> 
> I need a way where I get the ENTIRE Message Node in the onInvite() API.
> Please help me on this one as I have my release in a couple of days :(
> Thanks ! 
> 
> Best Regards,
> Gauri Padbidri
> 
> -----Original Message-----
> From: conversejs@librelist.com [mailto:conversejs@librelist.com] On Behalf
> Of JC Brand
> Sent: Wednesday, March 25, 2015 5:02 PM
> To: conversejs@librelist.com
> Subject: Re: [conversejs] Feature : On login ignore old room join requests
> 
> On Mon, Mar 23, 2015 at 06:07:15PM +0530, Gauri Padbidri wrote:
> > Hi JC,
> > 
> > Can you help me identify the API that helps me checks the existence of a
> Chat Room ? Thanks !
> 
> Hi Gauri
> 
> The closest thing to that in converse.js is the showRooms method:
> 
> https://github.com/jcbrand/converse.js/blob/8469bf0a0d99ff8f14e6c64a9829100e
> e71dbdd6/converse.js#L1848
> 
> I'm not sure if there is a way to search for a particular room in XMPP,
> you'll have to read XEP-45 and do some searching to find out.
> 
> Regards
> JC
> 
> 
> 
> > -----Original Message-----
> > From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com]
> > Sent: Saturday, March 21, 2015 1:10 AM
> > To: 'conversejs@librelist.com'
> > Subject: RE: [conversejs] Feature : On login ignore old room join 
> > requests
> > 
> > Hey JC,
> > 
> > Thanks for your help ! Can you please tell me how I can check the
> existence of a Chat Room ? How do I check if the Chat Room exists or not ?
> > 
> > Best Regards,
> > Gauri Padbidri
> > 
> > -----Original Message-----
> > From: conversejs@librelist.com [mailto:conversejs@librelist.com] On 
> > Behalf Of JC Brand
> > Sent: Friday, March 20, 2015 2:20 PM
> > To: conversejs@librelist.com
> > Subject: Re: [conversejs] Feature : On login ignore old room join 
> > requests
> > 
> > Hi Guari
> > 
> > On Wed, Mar 18, 2015 at 10:35:56PM +0530, Gauri Padbidri wrote:
> > >    I have modified code to create Private Chat Rooms programatically.
> > >    However, when I have sent out the invite to users and the room does
> not
> > >    exist anymore, the user still gets notifications. Following is my
> test
> > >    case :
> > > 
> > >     1. Login as "User A"
> > >     2. Click some icon that opens the autocomplete text filed, which
> helps
> > >        inviting users to join ChatRoom.
> > >     3. Send invites to "User B", "User C" and "User D".
> > >     4. Assuming the invite is accepted by "User B" and "User C". So now
> > >        ChatRo om participants are : User A, User B, User C.
> > >     5. Consider that ALL users leave the ChatRoom. (Meaning the Chat
> Room
> > >        does not exist as there are no participants)
> > >     6. Now "User D" logs in and he gets the invitation, but the room
> does not
> > >        exist.
> > > 
> > >    Result : I want to DISABLE the feature of users getting "chatroom i
> > >    nvites" immideately after login....Where in the Converse JS is the
> code
> > >    that displays ALL the queued offline messages / invites, etc...Please
> let
> > >    me know the API that is responsible for displaying users with invites
> > >    immideately after login.
> > 
> > They way I would approach this would be to write a plugin for converse.js
> which overrides the onInvite handler.
> > 
> > That handler is registered here:
> > https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527d
> > d89f08c2f61f11/converse.js#L2997
> > 
> > And the definition is here:
> > https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527d
> > d89f08c2f61f11/converse.js#L2997
> > 
> > You'll want to put a check in that method to see whether the chat room
> exists before continuing.
> > 
> > JC
> > 
> 

Re: [conversejs] Feature : On login ignore old room join requests

From:
Gauri Padbidri
Date:
2015-03-26 @ 14:20
Hi JC,

Tweaking a little bit using Fiddler, I found that when a user already has
OFFLINE Chat Room Invites in his queue, and he logs in, he gets all the
pending invite requests. When I observed the Fiddler response, as to how the
OFFLINE Chat Room Invites come,  I see the following output in Fiddler,
which is interesting (as it tags ALL Invites as "Offline Storage") : 

<message xmlns='jabber:client'
from='gauri@someDomain.com/converse.js-100245555' to='deepak@
someDomain.com' id='30'>
	<x xmlns='jabber:x:conference' jid='nilesh,deepak@lobby.
someDomain.com' reason='Join the Private Group Chat'/>
	<delay xmlns='urn:xmpp:delay' from=' someDomain.com'
stamp='2015-03-26T13:49:36Z'>Offline Storage</delay>
	<x xmlns='jabber:x:delay' stamp='20150326T13:49:36'/>
</message>

Also, when the onInvite() Event is invoked, it is bound as follows : 
converse.connection.addHandler(
                    $.proxy(function (message) {
                        this.onInvite(message);
                        return true;
                    }, this), 'jabber:x:conference', 'message');

However, the onInvite(message) does NOT receive the ENTIRE Message Node.
However, if I get the entire Message Node I can see if it is "Offline
Storage" and avoid offline Chat Room invites...How can I do that ? Where is
the filter that only makes the following available as "message" : 

<message xmlns='jabber:client' from='gauri@
someDomain.com/converse.js-100244592' to='deepak@ someDomain.com' id='30'>
	<x xmlns='jabber:x:conference' jid='nilesh,deepak@lobby.
someDomain.com' reason='Join the Private Group Chat'/>
</message>

I need a way where I get the ENTIRE Message Node in the onInvite() API.
Please help me on this one as I have my release in a couple of days :(
Thanks ! 

Best Regards,
Gauri Padbidri

-----Original Message-----
From: conversejs@librelist.com [mailto:conversejs@librelist.com] On Behalf
Of JC Brand
Sent: Wednesday, March 25, 2015 5:02 PM
To: conversejs@librelist.com
Subject: Re: [conversejs] Feature : On login ignore old room join requests

On Mon, Mar 23, 2015 at 06:07:15PM +0530, Gauri Padbidri wrote:
> Hi JC,
> 
> Can you help me identify the API that helps me checks the existence of a
Chat Room ? Thanks !

Hi Gauri

The closest thing to that in converse.js is the showRooms method:

https://github.com/jcbrand/converse.js/blob/8469bf0a0d99ff8f14e6c64a9829100e
e71dbdd6/converse.js#L1848

I'm not sure if there is a way to search for a particular room in XMPP,
you'll have to read XEP-45 and do some searching to find out.

Regards
JC



> -----Original Message-----
> From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com]
> Sent: Saturday, March 21, 2015 1:10 AM
> To: 'conversejs@librelist.com'
> Subject: RE: [conversejs] Feature : On login ignore old room join 
> requests
> 
> Hey JC,
> 
> Thanks for your help ! Can you please tell me how I can check the
existence of a Chat Room ? How do I check if the Chat Room exists or not ?
> 
> Best Regards,
> Gauri Padbidri
> 
> -----Original Message-----
> From: conversejs@librelist.com [mailto:conversejs@librelist.com] On 
> Behalf Of JC Brand
> Sent: Friday, March 20, 2015 2:20 PM
> To: conversejs@librelist.com
> Subject: Re: [conversejs] Feature : On login ignore old room join 
> requests
> 
> Hi Guari
> 
> On Wed, Mar 18, 2015 at 10:35:56PM +0530, Gauri Padbidri wrote:
> >    I have modified code to create Private Chat Rooms programatically.
> >    However, when I have sent out the invite to users and the room does
not
> >    exist anymore, the user still gets notifications. Following is my
test
> >    case :
> > 
> >     1. Login as "User A"
> >     2. Click some icon that opens the autocomplete text filed, which
helps
> >        inviting users to join ChatRoom.
> >     3. Send invites to "User B", "User C" and "User D".
> >     4. Assuming the invite is accepted by "User B" and "User C". So now
> >        ChatRo om participants are : User A, User B, User C.
> >     5. Consider that ALL users leave the ChatRoom. (Meaning the Chat
Room
> >        does not exist as there are no participants)
> >     6. Now "User D" logs in and he gets the invitation, but the room
does not
> >        exist.
> > 
> >    Result : I want to DISABLE the feature of users getting "chatroom i
> >    nvites" immideately after login....Where in the Converse JS is the
code
> >    that displays ALL the queued offline messages / invites, etc...Please
let
> >    me know the API that is responsible for displaying users with invites
> >    immideately after login.
> 
> They way I would approach this would be to write a plugin for converse.js
which overrides the onInvite handler.
> 
> That handler is registered here:
> https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527d
> d89f08c2f61f11/converse.js#L2997
> 
> And the definition is here:
> https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527d
> d89f08c2f61f11/converse.js#L2997
> 
> You'll want to put a check in that method to see whether the chat room
exists before continuing.
> 
> JC
> 

Re: [conversejs] Feature : On login ignore old room join requests

From:
Jc Brand
Date:
2015-03-26 @ 14:39
On Thu, Mar 26, 2015 at 07:50:43PM +0530, Gauri Padbidri wrote:
> Hi JC,
> 
> Tweaking a little bit using Fiddler, I found that when a user already has
> OFFLINE Chat Room Invites in his queue, and he logs in, he gets all the
> pending invite requests. When I observed the Fiddler response, as to how the
> OFFLINE Chat Room Invites come,  I see the following output in Fiddler,
> which is interesting (as it tags ALL Invites as "Offline Storage") : 
> 
> <message xmlns='jabber:client'
> from='gauri@someDomain.com/converse.js-100245555' to='deepak@
> someDomain.com' id='30'>
> 	<x xmlns='jabber:x:conference' jid='nilesh,deepak@lobby.
> someDomain.com' reason='Join the Private Group Chat'/>
> 	<delay xmlns='urn:xmpp:delay' from=' someDomain.com'
> stamp='2015-03-26T13:49:36Z'>Offline Storage</delay>
> 	<x xmlns='jabber:x:delay' stamp='20150326T13:49:36'/>
> </message>
> 
> Also, when the onInvite() Event is invoked, it is bound as follows : 
> converse.connection.addHandler(
>                     $.proxy(function (message) {
>                         this.onInvite(message);
>                         return true;
>                     }, this), 'jabber:x:conference', 'message');
> 
> However, the onInvite(message) does NOT receive the ENTIRE Message Node.
> However, if I get the entire Message Node I can see if it is "Offline
> Storage" and avoid offline Chat Room invites...How can I do that ? Where is
> the filter that only makes the following available as "message" : 
> 
> <message xmlns='jabber:client' from='gauri@
> someDomain.com/converse.js-100244592' to='deepak@ someDomain.com' id='30'>
> 	<x xmlns='jabber:x:conference' jid='nilesh,deepak@lobby.
> someDomain.com' reason='Join the Private Group Chat'/>
> </message>

I'm not aware of any code that strips out parts of the XML stanza.

You'll have to step through the Strophe.js code and see if something perhaps
happens there.

"connection.addHandler" comes from Strophe.js and when "onInvite" is called,
the call stack won't include any calls to converse.js itself (at least not
that I know of).

So I don't think this is something in converse.js but instead in its 
dependency Strophe.js.

JC

Re: [conversejs] Feature : On login ignore old room join requests

From:
Gauri Padbidri
Date:
2015-03-20 @ 19:39
Hey JC, 

Thanks for your help ! Can you please tell me how I can check the 
existence of a Chat Room ? How do I check if the Chat Room exists or not ?

Best Regards,
Gauri Padbidri

-----Original Message-----
From: conversejs@librelist.com [mailto:conversejs@librelist.com] On Behalf
Of JC Brand
Sent: Friday, March 20, 2015 2:20 PM
To: conversejs@librelist.com
Subject: Re: [conversejs] Feature : On login ignore old room join requests

Hi Guari

On Wed, Mar 18, 2015 at 10:35:56PM +0530, Gauri Padbidri wrote:
>    I have modified code to create Private Chat Rooms programatically.
>    However, when I have sent out the invite to users and the room does not
>    exist anymore, the user still gets notifications. Following is my test
>    case :
> 
>     1. Login as "User A"
>     2. Click some icon that opens the autocomplete text filed, which helps
>        inviting users to join ChatRoom.
>     3. Send invites to "User B", "User C" and "User D".
>     4. Assuming the invite is accepted by "User B" and "User C". So now
>        ChatRo om participants are : User A, User B, User C.
>     5. Consider that ALL users leave the ChatRoom. (Meaning the Chat Room
>        does not exist as there are no participants)
>     6. Now "User D" logs in and he gets the invitation, but the room does not
>        exist.
> 
>    Result : I want to DISABLE the feature of users getting "chatroom i
>    nvites" immideately after login....Where in the Converse JS is the code
>    that displays ALL the queued offline messages / invites, etc...Please let
>    me know the API that is responsible for displaying users with invites
>    immideately after login.

They way I would approach this would be to write a plugin for converse.js 
which overrides the onInvite handler.

That handler is registered here:

https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527dd89f08c2f61f11/converse.js#L2997

And the definition is here:

https://github.com/jcbrand/converse.js/blob/c1d48b6f2cf9556c22446e527dd89f08c2f61f11/converse.js#L2997

You'll want to put a check in that method to see whether the chat room 
exists before continuing.

JC