librelist archives

« back to archive

Cannot open chatbox

Cannot open chatbox

From:
Simon Hill
Date:
2015-03-10 @ 18:29
I'm trying to follow these instructions:

open <https://conversejs.org/docs/html/development.html#open>

Opens a chat box and returns an object representing a chat box.

To open a single chat box, provide the JID of the contact:

converse.chats.get('buddy@example.com')

To return an array of chat boxes, provide an array of JIDs:

converse.chats.get(['buddy1@example.com', 'buddy2@example.com'])

*The returned chat box contains the following methods:*
MethodDescriptionendOTREnd an OTR (Off-the-record) session.getGet an
attribute (i.e. accessor).initiateOTRStart an OTR (off-the-record) session.
maximizeMinimize the chat box.minimizeMaximize the chat box.setSet an
attribute (i.e. mutator).closeClose the chat box.

This is a little confusing. Is it .open() that opens the chatbox? Or does
an unqualified .get() open the chatbox? Either way, I can't get this syntax
or its variant to open the chatbox for the named JID in the buddy list.

converse.listen.once('ready', function () {
    converse.chats.get('name@domain.me').open();

});

Any help much appreciated.
Si

Re: [conversejs] Cannot open chatbox

From:
Jc Brand
Date:
2015-03-11 @ 11:49
On Tue, Mar 10, 2015 at 11:29:02AM -0700, Simon Hill wrote:
>    I'm trying to follow these instructions:
> 
>     open
> 
>    Opens a chat box and returns an object representing a chat box.
> 
>    To open a single chat box, provide the JID of the contact:
> 
>  converse.chats.get('[1]buddy@example.com')
> 
>    To return an array of chat boxes, provide an array of JIDs:
> 
>  converse.chats.get(['[2]buddy1@example.com', '[3]buddy2@example.com'])
> 
>    The returned chat box contains the following methods:
> 
>    < tbody valign="top">
>         Method                             Description
>    endOTR            End an OTR (Off-the-record) session.
>    get               Get an attribute (i.e. accessor).
>    initiateOTR       Start an OTR (off-the-record) session.
>    maximize          Minimize the chat box.
>    minimize          Maximize the chat box.
>    set               Set an attribute (i.e. mutator).
>    close             Close the chat box.
> 
>    This is a little confusing. Is it .open() that opens the chatbox? Or does
>    an unqualified .get() open the chatbox? Either way, I can't get this
>    syntax or its variant to open the chatbox for the named JID in the buddy
>    list.

>  converse.listen.once('ready', function () {
>      converse.chats.get('[4]name@domain.me').open();
> 
>  });

It should be "converse.chats.open", that was a typo which I've now fixed.

Re: [conversejs] Cannot open chatbox

From:
Simon Hill
Date:
2015-03-11 @ 15:25
That worked, thanks.

On Wed, Mar 11, 2015 at 4:49 AM, JC Brand <lists@opkode.com> wrote:

> On Tue, Mar 10, 2015 at 11:29:02AM -0700, Simon Hill wrote:
> >    I'm trying to follow these instructions:
> >
> >     open
> >
> >    Opens a chat box and returns an object representing a chat box.
> >
> >    To open a single chat box, provide the JID of the contact:
> >
> >  converse.chats.get('[1]buddy@example.com')
> >
> >    To return an array of chat boxes, provide an array of JIDs:
> >
> >  converse.chats.get(['[2]buddy1@example.com', '[3]buddy2@example.com'])
> >
> >    The returned chat box contains the following methods:
> >
> >    < tbody valign="top">
> >         Method                             Description
> >    endOTR            End an OTR (Off-the-record) session.
> >    get               Get an attribute (i.e. accessor).
> >    initiateOTR       Start an OTR (off-the-record) session.
> >    maximize          Minimize the chat box.
> >    minimize          Maximize the chat box.
> >    set               Set an attribute (i.e. mutator).
> >    close             Close the chat box.
> >
> >    This is a little confusing. Is it .open() that opens the chatbox? Or
> does
> >    an unqualified .get() open the chatbox? Either way, I can't get this
> >    syntax or its variant to open the chatbox for the named JID in the
> buddy
> >    list.
>
> >  converse.listen.once('ready', function () {
> >      converse.chats.get('[4]name@domain.me').open();
> >
> >  });
>
> It should be "converse.chats.open", that was a typo which I've now fixed.
>