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
2179255d
Commit
2179255d
authored
Nov 07, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add button for resyncing roster contacts
parent
5e7d5d7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
src/converse-rosterview.js
src/converse-rosterview.js
+12
-1
src/headless/converse-roster.js
src/headless/converse-roster.js
+7
-3
src/templates/roster.html
src/templates/roster.html
+1
-0
No files found.
src/converse-rosterview.js
View file @
2179255d
...
...
@@ -751,6 +751,7 @@ converse.plugins.add('converse-rosterview', {
events
:
{
'
click a.controlbox-heading__btn.add-contact
'
:
'
showAddContactModal
'
,
'
click a.controlbox-heading__btn.sync-contacts
'
:
'
syncContacts
'
},
initialize
()
{
...
...
@@ -787,7 +788,8 @@ converse.plugins.add('converse-rosterview', {
this
.
el
.
innerHTML
=
tpl_roster
({
'
allow_contact_requests
'
:
_converse
.
allow_contact_requests
,
'
heading_contacts
'
:
__
(
'
Contacts
'
),
'
title_add_contact
'
:
__
(
'
Add a contact
'
)
'
title_add_contact
'
:
__
(
'
Add a contact
'
),
'
title_sync_contacts
'
:
__
(
'
Re-sync your contacts
'
)
});
const
form
=
this
.
el
.
querySelector
(
'
.roster-filter-form
'
);
this
.
el
.
replaceChild
(
this
.
filter_view
.
render
().
el
,
form
);
...
...
@@ -861,6 +863,15 @@ converse.plugins.add('converse-rosterview', {
}
},
async
syncContacts
(
ev
)
{
ev
.
preventDefault
();
u
.
addClass
(
'
fa-spin
'
,
ev
.
target
);
_converse
.
roster
.
data
.
save
(
'
version
'
,
null
);
await
_converse
.
roster
.
fetchFromServer
();
_converse
.
xmppstatus
.
sendPresence
();
u
.
removeClass
(
'
fa-spin
'
,
ev
.
target
);
},
reset
()
{
_converse
.
roster
.
reset
();
this
.
removeAll
();
...
...
src/headless/converse-roster.js
View file @
2179255d
...
...
@@ -401,8 +401,12 @@ converse.plugins.add('converse-roster', {
let
collection
;
try
{
collection
=
await
new
Promise
((
resolve
,
reject
)
=>
{
const
config
=
{
'
add
'
:
true
,
'
silent
'
:
true
,
'
success
'
:
resolve
,
'
error
'
:
reject
};
this
.
fetch
(
config
);
this
.
fetch
({
'
add
'
:
true
,
'
silent
'
:
true
,
'
success
'
:
resolve
,
'
error
'
:
reject
});
});
}
catch
(
e
)
{
return
_converse
.
log
(
e
,
Strophe
.
LogLevel
.
ERROR
);
...
...
@@ -562,7 +566,7 @@ converse.plugins.add('converse-roster', {
},
rosterVersioningSupported
()
{
return
_converse
.
api
.
disco
.
stream
.
getFeature
(
'
ver
'
,
'
urn:xmpp:features:rosterver
'
)
&&
this
.
data
.
get
(
'
version
'
);
return
!!
(
_converse
.
api
.
disco
.
stream
.
getFeature
(
'
ver
'
,
'
urn:xmpp:features:rosterver
'
)
&&
this
.
data
.
get
(
'
version
'
)
);
},
async
fetchFromServer
()
{
...
...
src/templates/roster.html
View file @
2179255d
<div
class=
"d-flex controlbox-padded"
>
<span
class=
"w-100 controlbox-heading"
>
{{{o.heading_contacts}}}
</span>
<a
class=
"controlbox-heading__btn sync-contacts fa fa-sync"
title=
"{{{o.title_sync_contacts}}}"
></a>
{[ if (o.allow_contact_requests) { ]}
<a
class=
"controlbox-heading__btn add-contact fa fa-user-plus"
title=
"{{{o.title_add_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