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
40726e06
Commit
40726e06
authored
Dec 31, 2019
by
Christoph Scholz
Committed by
JC Brand
Jan 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A user can now add himself as a contact
parent
e2d744dd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
CHANGES.md
CHANGES.md
+1
-0
src/converse-rosterview.js
src/converse-rosterview.js
+10
-4
src/headless/converse-roster.js
src/headless/converse-roster.js
+0
-1
No files found.
CHANGES.md
View file @
40726e06
...
...
@@ -6,6 +6,7 @@
-
#1820: Set focus on jid field after controlbox is loaded
-
#1823: New config options
[
muc_roomid_policy
](
https://conversejs.org/docs/html/configuration.html#muc-roomid-policy
)
and
[
muc_roomid_policy_hint
](
https://conversejs.org/docs/html/configuration.html#muc-roomid-policy-hint
)
-
#1826: A user can now add himself as a contact
## 6.0.0 (2020-01-09)
...
...
src/converse-rosterview.js
View file @
40726e06
...
...
@@ -358,7 +358,8 @@ converse.plugins.add('converse-rosterview', {
const
ask
=
this
.
model
.
get
(
'
ask
'
),
show
=
this
.
model
.
presence
.
get
(
'
show
'
),
requesting
=
this
.
model
.
get
(
'
requesting
'
),
subscription
=
this
.
model
.
get
(
'
subscription
'
);
subscription
=
this
.
model
.
get
(
'
subscription
'
),
jid
=
this
.
model
.
get
(
'
jid
'
);
const
classes_to_remove
=
[
'
current-xmpp-contact
'
,
...
...
@@ -414,7 +415,7 @@ converse.plugins.add('converse-rosterview', {
'
allow_chat_pending_contacts
'
:
_converse
.
allow_chat_pending_contacts
})
);
}
else
if
(
subscription
===
'
both
'
||
subscription
===
'
to
'
)
{
}
else
if
(
subscription
===
'
both
'
||
subscription
===
'
to
'
||
_converse
.
rosterview
.
isSelf
(
jid
)
)
{
this
.
el
.
classList
.
add
(
'
current-xmpp-contact
'
);
this
.
el
.
classList
.
remove
(
without
([
'
both
'
,
'
to
'
],
subscription
)[
0
]);
this
.
el
.
classList
.
add
(
subscription
);
...
...
@@ -947,13 +948,18 @@ converse.plugins.add('converse-rosterview', {
groups
.
forEach
(
g
=>
this
.
addContactToGroup
(
contact
,
g
,
options
));
},
isSelf
(
jid
)
{
return
u
.
isSameBareJID
(
jid
,
_converse
.
connection
.
jid
);
},
addRosterContact
(
contact
,
options
)
{
if
(
contact
.
get
(
'
subscription
'
)
===
'
both
'
||
contact
.
get
(
'
subscription
'
)
===
'
to
'
)
{
const
jid
=
contact
.
get
(
'
jid
'
);
if
(
contact
.
get
(
'
subscription
'
)
===
'
both
'
||
contact
.
get
(
'
subscription
'
)
===
'
to
'
||
this
.
isSelf
(
jid
))
{
this
.
addExistingContact
(
contact
,
options
);
}
else
{
if
(
!
_converse
.
allow_contact_requests
)
{
log
.
debug
(
`Not adding requesting or pending contact
${
contact
.
get
(
'
jid
'
)
}
`
+
`Not adding requesting or pending contact
${
jid
}
`
+
`because allow_contact_requests is false`
);
return
;
...
...
src/headless/converse-roster.js
View file @
40726e06
...
...
@@ -655,7 +655,6 @@ converse.plugins.add('converse-roster', {
*/
updateContact
(
item
)
{
const
jid
=
item
.
getAttribute
(
'
jid
'
);
if
(
this
.
isSelf
(
jid
))
{
return
;
}
const
contact
=
this
.
get
(
jid
);
const
subscription
=
item
.
getAttribute
(
"
subscription
"
);
...
...
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