librelist archives

« back to archive

Re: ConverseJS : Display a FLAT List of Users without their Roster Groups.

Re: ConverseJS : Display a FLAT List of Users without their Roster Groups.

From:
Gauri Padbidri
Date:
2015-02-23 @ 22:29
Hi All,

 

Sorry to bother you, but I found out the Configuration variable :
'roster_groups : false' which does exactly that.. This problem is resolved. 

 

Now I have another issue : 

Steps to reproduce : 

1.      Login to the ConverseJS Web Client.

2.      Observe the Contacts Panel View. It will have all online members on
TOP and hence the Contact / Roster List will not be in alphabetical order.

3.      Now comment the following line in converse.js :
this.RosterGroupView.initialize() -> this.model.contacts.sort(); // Comment
this line

4.      Clear Browser Cache and repeat Step #1.

5.      Observe that now the Contacts are in alphabetical order.

6.      Now, Refresh the page.

7.      OBSERVE : We see results like Step #2 meaning Online members stacked
on TOP.

Result : I need Contact List on the basis of their Alphabetical Order and
not based on their online status on Page refresh as well.

 

Where  can I fix this issue ? Which code gets called when I refresh the
page. 

 

Best Regards,

Gauri Padbidri

 

 

From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com] 
Sent: Tuesday, February 24, 2015 3:28 AM
To: 'conversejs@librelist.com'
Subject: FW: ConverseJS : Display a FLAT List of Users without their Roster
Groups.

 

 

 

From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com] 
Sent: Tuesday, February 24, 2015 3:02 AM
To: 'conversejs@librelist.com'
Subject: ConverseJS : Display a FLAT List of Users without their Roster
Groups.

 

Hi All,

 

I have ConverseJS Web Client (Latest Version) setup on my website. I want a
FLATTENED Roster List being displayed in my Contacts Panel. I want to
display a FLAT List of Users just like Facebook shows. How can I achieve
that ? Where can I tweak the code for it ? I want to achieve the following :

.         Regardless of the Chat Status (Online / Offline) I want users to
be listed in alphabetical order.

.         I want users to be displayed without their Shared Roster Groups..
I need a flat list that would to merge ALL Contacts across all available
groups and show them to user in a flat list just like Facebook (in terms of
NO Grouping, but a flat list).

Can you give me any pointers on how I can tweak the code ? Thanks !

Best Regards,

Gauri Padbidri

Re: [conversejs] RE: ConverseJS : Display a FLAT List of Users without their Roster Groups.

From:
Jc Brand
Date:
2015-02-24 @ 10:27
Hi Gauri

The sort() method for roster contacts has a custom comparator which makes sure
that users are shown first by online status and then alphabetically.

If you want to show users alphabetically and without regard to their status,
then you need to modify the comparator:

https://github.com/jcbrand/converse.js/blob/master/converse.js#L3423

Regards
JC

On Tue, Feb 24, 2015 at 03:59:15AM +0530, Gauri Padbidri wrote:
>    Hi All,
> 
>     
> 
>    Sorry to bother you, but I found out the Configuration variable :
>    ‘roster_groups : false’ which does exactly that.. This problem is
>    resolved.
> 
>     
> 
>    Now I have another issue :
> 
>    Steps to reproduce :
> 
>    1.      Login to the ConverseJS Web Client.
> 
>    2.      Observe the Contacts Panel View. It will have all online members
>    on TOP and hence the Contact / Roster List will not be in alphabetical
>    order.
> 
>    3.      Now comment the following line in converse.js :
>     this.RosterGroupView.initialize() -> this.model.contacts.sort(); //
>    Comment this line
> 
>    4.      Clear Browser Cache and repeat Step #1.
> 
>    5.      Observe that now the Contacts are in alphabetical order.
> 
>    6.      Now, Refresh the page.
> 
>    7.      OBSERVE : We see results like Step #2 meaning Online members
>    stacked on TOP.
> 
>    Result : I need Contact List on the basis of their Alphabetical Order and
>    not based on their online status on Page refresh as well.
> 
>     
> 
>    Where  can I fix this issue ? Which code gets called when I refresh the
>    page.
> 
>     
> 
>    Best Regards,
> 
>    Gauri Padbidri
> 
>    < span style='color:#1F497D'> 
> 
>     
> 
>    From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com]
>    Sent: Tuesday, February 24, 2015 3:28 AM
>    To: 'conversejs@librelist.com'
>    Subject: FW: ConverseJS : Display a FLAT List of Users without their
>    Roster Groups.
> 
>     
> 
>     
> 
>     
> 
>    From: Gauri Padbidri [[1]mailto:gpadbidri@genius-minds.com]
>    Sent: Tuesday, February 24, 2015 3:02 AM
>    To: 'conversejs@librelist.com'
>    Subject: ConverseJS : Display a FLAT List of Users without their Roster
>    Groups.
> 
>     
> 
>    Hi All,
> 
>     
> 
>    I have ConverseJS Web Client (Latest Version) setup on my website. I want
>    a FLATTENED Roster List being displayed in my Contacts Panel. I want to di
>    splay a FLAT List of Users just like Facebook shows. How can I achieve
>    that ? Where can I tweak the code for it ? I want to achieve the following
>    :
> 
>    ·         Regardless of the Chat Status (Online / Offline) I want users to
>    be listed in alphabetical order.
> 
>    ·         I want users to be displayed without their Shared Roster
>    Groups.. I need a flat list that would to merge ALL Contacts across all
>    available groups and show them to user in a flat list just like Facebook
>    (in terms of NO Grouping, but a flat list).
> 
>    Can you give me any pointers on how I can tweak the code ? Thanks !
> 
>    Best Regards,
> 
>    Gauri Padbidri
> 
> References
> 
>    Visible links
>    1. mailto:gpadbidri@genius-minds.com

Re: [conversejs] RE: ConverseJS : Display a FLAT List of Users without their Roster Groups.

From:
Gauri Padbidri
Date:
2015-02-24 @ 14:06
Hey, Thanks ! This one helped me a lot.. Thanks for your support.

-----Original Message-----
From: conversejs@librelist.com [mailto:conversejs@librelist.com] On Behalf
Of JC Brand
Sent: Tuesday, February 24, 2015 3:57 PM
To: conversejs@librelist.com
Subject: Re: [conversejs] RE: ConverseJS : Display a FLAT List of Users 
without their Roster Groups.

Hi Gauri

The sort() method for roster contacts has a custom comparator which makes 
sure that users are shown first by online status and then alphabetically.

If you want to show users alphabetically and without regard to their 
status, then you need to modify the comparator:

https://github.com/jcbrand/converse.js/blob/master/converse.js#L3423

Regards
JC

On Tue, Feb 24, 2015 at 03:59:15AM +0530, Gauri Padbidri wrote:
>    Hi All,
> 
>     
> 
>    Sorry to bother you, but I found out the Configuration variable :
>    ‘roster_groups : false’ which does exactly that.. This problem is
>    resolved.
> 
>     
> 
>    Now I have another issue :
> 
>    Steps to reproduce :
> 
>    1.      Login to the ConverseJS Web Client.
> 
>    2.      Observe the Contacts Panel View. It will have all online members
>    on TOP and hence the Contact / Roster List will not be in alphabetical
>    order.
> 
>    3.      Now comment the following line in converse.js :
>     this.RosterGroupView.initialize() -> this.model.contacts.sort(); //
>    Comment this line
> 
>    4.      Clear Browser Cache and repeat Step #1.
> 
>    5.      Observe that now the Contacts are in alphabetical order.
> 
>    6.      Now, Refresh the page.
> 
>    7.      OBSERVE : We see results like Step #2 meaning Online members
>    stacked on TOP.
> 
>    Result : I need Contact List on the basis of their Alphabetical Order and
>    not based on their online status on Page refresh as well.
> 
>     
> 
>    Where  can I fix this issue ? Which code gets called when I refresh the
>    page.
> 
>     
> 
>    Best Regards,
> 
>    Gauri Padbidri
> 
>    < span style='color:#1F497D'>
> 
>     
> 
>    From: Gauri Padbidri [mailto:gpadbidri@genius-minds.com]
>    Sent: Tuesday, February 24, 2015 3:28 AM
>    To: 'conversejs@librelist.com'
>    Subject: FW: ConverseJS : Display a FLAT List of Users without their
>    Roster Groups.
> 
>     
> 
>     
> 
>     
> 
>    From: Gauri Padbidri [[1]mailto:gpadbidri@genius-minds.com]
>    Sent: Tuesday, February 24, 2015 3:02 AM
>    To: 'conversejs@librelist.com'
>    Subject: ConverseJS : Display a FLAT List of Users without their Roster
>    Groups.
> 
>     
> 
>    Hi All,
> 
>     
> 
>    I have ConverseJS Web Client (Latest Version) setup on my website. I want
>    a FLATTENED Roster List being displayed in my Contacts Panel. I want to di
>    splay a FLAT List of Users just like Facebook shows. How can I achieve
>    that ? Where can I tweak the code for it ? I want to achieve the following
>    :
> 
>    ·         Regardless of the Chat Status (Online / Offline) I want users to
>    be listed in alphabetical order.
> 
>    ·         I want users to be displayed without their Shared Roster
>    Groups.. I need a flat list that would to merge ALL Contacts across all
>    available groups and show them to user in a flat list just like Facebook
>    (in terms of NO Grouping, but a flat list).
> 
>    Can you give me any pointers on how I can tweak the code ? Thanks !
> 
>    Best Regards,
> 
>    Gauri Padbidri
> 
> References
> 
>    Visible links
>    1. mailto:gpadbidri@genius-minds.com