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
cd3540de
Commit
cd3540de
authored
Nov 06, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finally figured out the subscription='from' ask='subscribe' thing
parent
5944ed99
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
1 deletion
+60
-1
converse.js
converse.js
+8
-1
docs/DEVELOPER.rst
docs/DEVELOPER.rst
+52
-0
No files found.
converse.js
View file @
cd3540de
...
@@ -2486,7 +2486,7 @@
...
@@ -2486,7 +2486,7 @@
this
.
$el
.
addClass
(
item
.
get
(
'
chat_status
'
));
this
.
$el
.
addClass
(
item
.
get
(
'
chat_status
'
));
if
(
(
ask
===
'
subscribe
'
)
&&
(
subscription
==
'
none
'
)
)
{
if
(
ask
===
'
subscribe
'
)
{
this
.
$el
.
addClass
(
'
pending-xmpp-contact
'
);
this
.
$el
.
addClass
(
'
pending-xmpp-contact
'
);
this
.
$el
.
html
(
this
.
pending_template
(
item
.
toJSON
()));
this
.
$el
.
html
(
this
.
pending_template
(
item
.
toJSON
()));
}
else
if
(
requesting
===
true
)
{
}
else
if
(
requesting
===
true
)
{
...
@@ -2900,6 +2900,13 @@
...
@@ -2900,6 +2900,13 @@
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
'
))
{
// TODO: We have accepted an incoming subscription
// 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)
$pending_contacts
.
after
(
view
.
render
().
el
);
$pending_contacts
.
after
(
$pending_contacts
.
siblings
(
'
dd.pending-xmpp-contact
'
).
tsort
(
crit
));
}
else
if
(
requesting
===
true
)
{
}
else
if
(
requesting
===
true
)
{
$contact_requests
.
after
(
view
.
render
().
el
);
$contact_requests
.
after
(
view
.
render
().
el
);
$contact_requests
.
after
(
$contact_requests
.
siblings
(
'
dd.requesting-xmpp-contact
'
).
tsort
(
crit
));
$contact_requests
.
after
(
$contact_requests
.
siblings
(
'
dd.requesting-xmpp-contact
'
).
tsort
(
crit
));
...
...
docs/DEVELOPER.rst
0 → 100644
View file @
cd3540de
Subscription flow
=================
Happy flow
----------
Contact1 makes a presence subscription request to contact2.
::
<presence type="subscribe" to="contact2@localhost"/>
Contact1 receives a roster update
::
<iq type="set" to="contact1@localhost">
<query xmlns="jabber:iq:roster">
<item jid="contact2@localhost" ask="subscribe" subscription="none"></item>
</query>
</iq>
Contact2 receives the presence subscription, but no
roster update. We create a roster item manually in
handleIncomingSubscription and add the 'requesting'
property to indicate that this is an incoming request.
Contact2 clicks "Accept". This confirms the
subscription and subscribes back.
::
<presence type="subscribed" to="contact1@localhost"/>
<presence type="subscribe" to="contact1@localhost"/>
Contact2 receives a roster update
::
<iq type="set" to="contact2@localhost">
<query xmlns="jabber:iq:roster">
<item jid="contact1@localhost" ask="subscribe" subscription="from"></item>
</query>
</iq>
Contact1's converse.js client will automatically
approve.
Contact2 receives a roster update (as does contact1).
::
<iq type="set" to="contact2@localhost">
<query xmlns="jabber:iq:roster">
<item jid="contact1@localhost" subscription="both"></item>
</query>
</iq>
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