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
1705aa8f
Commit
1705aa8f
authored
Jul 23, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix. Handle case where user accepts request.
But other user is not online to quickly subscribe back.
parent
40e767b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
converse.js
converse.js
+18
-6
docs/DEVELOPER.rst
docs/DEVELOPER.rst
+8
-1
No files found.
converse.js
View file @
1705aa8f
...
@@ -2883,7 +2883,12 @@
...
@@ -2883,7 +2883,12 @@
this
.
$el
.
addClass
(
chat_status
).
data
(
'
status
'
,
chat_status
);
this
.
$el
.
addClass
(
chat_status
).
data
(
'
status
'
,
chat_status
);
if
(
ask
===
'
subscribe
'
)
{
if
((
ask
===
'
subscribe
'
)
||
(
subscription
===
'
from
'
))
{
// if subscription === 'from', then they are subscribed to
// us, but not vice versa. We assume that there is a
// pending subscription from us to them (otherwise we're in
// a state not supported by converse.js), so the user is a
// "pending" contact.
this
.
$el
.
addClass
(
'
pending-xmpp-contact
'
);
this
.
$el
.
addClass
(
'
pending-xmpp-contact
'
);
this
.
$el
.
html
(
converse
.
templates
.
pending_contact
(
this
.
$el
.
html
(
converse
.
templates
.
pending_contact
(
_
.
extend
(
item
.
toJSON
(),
{
_
.
extend
(
item
.
toJSON
(),
{
...
@@ -3293,7 +3298,7 @@
...
@@ -3293,7 +3298,7 @@
},
},
removeAllRosterItemViews
:
function
()
{
removeAllRosterItemViews
:
function
()
{
var
views
=
this
.
removeAll
();
this
.
removeAll
();
this
.
updateRoster
();
this
.
updateRoster
();
return
this
;
return
this
;
},
},
...
@@ -3334,11 +3339,18 @@
...
@@ -3334,11 +3339,18 @@
if
((
ask
===
'
subscribe
'
)
&&
(
subscription
==
'
none
'
))
{
if
((
ask
===
'
subscribe
'
)
&&
(
subscription
==
'
none
'
))
{
$pending_contacts
.
after
(
view
.
render
().
el
);
$pending_contacts
.
after
(
view
.
render
().
el
);
$pending_contacts
.
after
(
$pending_contacts
.
siblings
(
'
dd.pending-xmpp-contact
'
).
tsort
(
crit
));
$pending_contacts
.
after
(
$pending_contacts
.
siblings
(
'
dd.pending-xmpp-contact
'
).
tsort
(
crit
));
}
else
if
((
ask
===
'
subscribe
'
)
&&
(
subscription
==
'
from
'
))
{
}
else
if
((
ask
===
'
subscribe
'
||
ask
===
null
)
&&
(
subscription
=
==
'
from
'
))
{
//
TODO:
We have accepted an incoming subscription
// We have accepted an incoming subscription
// request and (automatically) made our own subscription request back.
// request and (automatically) made our own subscription request back.
// It would be useful to update the roster here to show
//
// things are happening... (see docs/DEVELOPER.rst)
// From what I can tell: (see docs/DEVELOPER.rst)
// if ask == 'subscribe', then the other user is online.
// if ask == null, then the other user is not online currently.
//
// In either case, the other user is now subscribed to
// us (i.e. "from" them to us), and we have a pending
// subscription to them, so we show the user as a
// pending contact.
$pending_contacts
.
after
(
view
.
render
().
el
);
$pending_contacts
.
after
(
view
.
render
().
el
);
$pending_contacts
.
after
(
$pending_contacts
.
siblings
(
'
dd.pending-xmpp-contact
'
).
tsort
(
crit
));
$pending_contacts
.
after
(
$pending_contacts
.
siblings
(
'
dd.pending-xmpp-contact
'
).
tsort
(
crit
));
}
else
if
(
requesting
===
true
)
{
}
else
if
(
requesting
===
true
)
{
...
...
docs/DEVELOPER.rst
View file @
1705aa8f
...
@@ -30,7 +30,7 @@ subscription and subscribes back.
...
@@ -30,7 +30,7 @@ subscription and subscribes back.
<presence type="subscribed" to="contact1@localhost"/>
<presence type="subscribed" to="contact1@localhost"/>
<presence type="subscribe" to="contact1@localhost"/>
<presence type="subscribe" to="contact1@localhost"/>
Contact2 receives
a roster update
IF Contact1 is still online and likewise subscribes back, Contact2 will receive
a roster update
::
::
<iq type="set" to="contact2@localhost">
<iq type="set" to="contact2@localhost">
...
@@ -39,6 +39,13 @@ Contact2 receives a roster update
...
@@ -39,6 +39,13 @@ Contact2 receives a roster update
</query>
</query>
</iq>
</iq>
ELSE, Contact 2 will receive a roster update (but not an IQ stanza)
::
ask = null
subscription = "from"
Contact1's converse.js client will automatically
Contact1's converse.js client will automatically
approve.
approve.
...
...
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