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
4e7de9e5
Commit
4e7de9e5
authored
Aug 03, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle case where groups are added from browser storage.
update #83
parent
6a28420d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
converse.js
converse.js
+17
-17
No files found.
converse.js
View file @
4e7de9e5
...
...
@@ -3369,11 +3369,11 @@
this
.
registerRosterHandler
();
this
.
registerRosterXHandler
();
this
.
registerPresenceHandler
();
converse
.
roster
.
on
(
"
add
"
,
this
.
onAdd
,
this
);
converse
.
roster
.
on
(
'
change
'
,
this
.
onChange
,
this
);
converse
.
roster
.
on
(
"
remove
"
,
this
.
update
,
this
);
converse
.
roster
.
on
(
"
add
"
,
this
.
onContactAdd
,
this
);
converse
.
roster
.
on
(
'
change
'
,
this
.
onContactChange
,
this
);
converse
.
roster
.
on
(
"
destroy
"
,
this
.
update
,
this
);
converse
.
roster
.
on
(
"
remove
"
,
this
.
update
,
this
);
this
.
model
.
on
(
"
add
"
,
this
.
onGroupAdd
,
this
);
this
.
model
.
on
(
"
reset
"
,
this
.
reset
,
this
);
this
.
render
();
this
.
model
.
fetch
({
add
:
true
});
...
...
@@ -3423,7 +3423,13 @@
},
this
),
null
,
'
presence
'
,
null
);
},
onAdd
:
function
(
contact
)
{
onGroupAdd
:
function
(
group
)
{
var
view
=
new
converse
.
RosterGroupView
({
model
:
group
});
this
.
add
(
group
.
get
(
'
name
'
),
view
);
this
.
positionGroup
(
view
);
},
onContactAdd
:
function
(
contact
)
{
this
.
addRosterContact
(
contact
).
update
();
if
(
!
contact
.
get
(
'
vcard_updated
'
))
{
// This will update the vcard, which triggers a change
...
...
@@ -3432,7 +3438,7 @@
}
},
onChange
:
function
(
contact
)
{
onC
ontactC
hange
:
function
(
contact
)
{
this
.
updateChatBox
(
contact
).
update
();
},
...
...
@@ -3464,27 +3470,21 @@
}
else
{
$
(
this
.
$
(
'
.roster-group
'
).
eq
(
index
)).
before
(
view
.
$el
);
}
return
view
;
},
getGroup
:
function
(
name
)
{
/* Returns the group
view
as specified by name.
* Creates the
view
if it doesn't exist.
/* Returns the group as specified by name.
* Creates the
group
if it doesn't exist.
*/
var
view
=
this
.
get
(
name
);
if
(
view
)
{
return
view
;
return
view
.
model
;
}
view
=
new
converse
.
RosterGroupView
({
model
:
this
.
model
.
create
({
name
:
name
,
id
:
b64_sha1
(
name
)}),
});
this
.
add
(
name
,
view
);
return
this
.
positionGroup
(
view
);
return
this
.
model
.
create
({
name
:
name
,
id
:
b64_sha1
(
name
)});
},
addContactToGroup
:
function
(
contact
,
name
)
{
var
group
=
this
.
getGroup
(
name
);
group
.
model
.
contacts
.
add
(
contact
);
this
.
getGroup
(
name
).
contacts
.
add
(
contact
);
},
addCurrentContact
:
function
(
contact
)
{
...
...
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