Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
93d56898
Commit
93d56898
authored
Nov 03, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1772. Wait for roster to be fetched
parent
1cba506b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
CHANGES.md
CHANGES.md
+1
-0
src/headless/converse-roster.js
src/headless/converse-roster.js
+3
-2
No files found.
CHANGES.md
View file @
93d56898
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
-
#1691: Fix
`collection.chatbox is undefined`
errors
-
#1691: Fix
`collection.chatbox is undefined`
errors
-
#1733: New message notifications for a minimized chat stack on top of each other
-
#1733: New message notifications for a minimized chat stack on top of each other
-
#1757: Chats are hidden behind the controlbox on mobile
-
#1757: Chats are hidden behind the controlbox on mobile
-
#1772
`_converse.api.contact.add(jid, nick)`
fails, says not a function
-
Prevent editing of sent file uploads.
-
Prevent editing of sent file uploads.
-
Initial support for sending custom emojis. Currently only between Converse
-
Initial support for sending custom emojis. Currently only between Converse
instances. Still working out a wire protocol for compatibility with other clients.
instances. Still working out a wire protocol for compatibility with other clients.
...
...
src/headless/converse-roster.js
View file @
93d56898
...
@@ -1075,8 +1075,9 @@ converse.plugins.add('converse-roster', {
...
@@ -1075,8 +1075,9 @@ converse.plugins.add('converse-roster', {
* @example
* @example
* _converse.api.contacts.add('buddy@example.com', 'Buddy')
* _converse.api.contacts.add('buddy@example.com', 'Buddy')
*/
*/
'
add
'
(
jid
,
name
)
{
async
add
(
jid
,
name
)
{
if
(
!
_
.
isString
(
jid
)
||
!
_
.
includes
(
jid
,
'
@
'
))
{
await
_converse
.
api
.
waitUntil
(
'
rosterContactsFetched
'
);
if
(
!
_
.
isString
(
jid
)
||
!
jid
.
includes
(
'
@
'
))
{
throw
new
TypeError
(
'
contacts.add: invalid jid
'
);
throw
new
TypeError
(
'
contacts.add: invalid jid
'
);
}
}
_converse
.
roster
.
addAndSubscribe
(
jid
,
_
.
isEmpty
(
name
)?
jid
:
name
);
_converse
.
roster
.
addAndSubscribe
(
jid
,
_
.
isEmpty
(
name
)?
jid
:
name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment