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
dfc1b73d
Commit
dfc1b73d
authored
Mar 05, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor some code out of the presenceHandler.
Also, don't hide the controlbox in the beginning, no need to.
parent
1966d5ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
16 deletions
+22
-16
converse.js
converse.js
+22
-16
No files found.
converse.js
View file @
dfc1b73d
...
...
@@ -1511,6 +1511,20 @@
return
0
;
},
subscribeBack
:
function
(
jid
)
{
// XXX: Why the distinction between jid and bare_jid?
var
bare_jid
=
Strophe
.
getBareJidFromJid
(
jid
)
if
(
xmppchat
.
connection
.
roster
.
findItem
(
bare_jid
))
{
xmppchat
.
connection
.
roster
.
authorize
(
bare_jid
);
xmppchat
.
connection
.
roster
.
subscribe
(
jid
);
}
else
{
xmppchat
.
connection
.
roster
.
add
(
jid
,
''
,
[],
function
(
iq
)
{
xmppchat
.
connection
.
roster
.
authorize
(
bare_jid
);
xmppchat
.
connection
.
roster
.
subscribe
(
jid
);
});
}
},
getNumOnlineContacts
:
function
()
{
var
count
=
0
,
models
=
this
.
models
,
...
...
@@ -1582,15 +1596,7 @@
// TODO see if auto_subscribe is truly an unresolved variable
if
(
xmppchat
.
auto_subscribe
)
{
if
((
!
item
)
||
(
item
.
get
(
'
subscription
'
)
!=
'
to
'
))
{
if
(
xmppchat
.
connection
.
roster
.
findItem
(
bare_jid
))
{
xmppchat
.
connection
.
roster
.
authorize
(
bare_jid
);
xmppchat
.
connection
.
roster
.
subscribe
(
jid
);
}
else
{
xmppchat
.
connection
.
roster
.
add
(
jid
,
''
,
[],
function
(
iq
)
{
xmppchat
.
connection
.
roster
.
authorize
(
bare_jid
);
xmppchat
.
connection
.
roster
.
subscribe
(
jid
);
});
}
this
.
subscribeBack
(
jid
);
}
else
{
xmppchat
.
connection
.
roster
.
authorize
(
bare_jid
);
}
...
...
@@ -1675,8 +1681,7 @@
delete
this
.
rosteritemviews
[
item
.
id
];
},
this
);
this
.
$el
.
hide
()
.
html
(
this
.
template
());
this
.
$el
.
html
(
this
.
template
());
},
template
:
_
.
template
(
'
<dt id="xmpp-contact-requests">Contact requests</dt>
'
+
...
...
@@ -1692,11 +1697,12 @@
$pending_contacts
=
this
.
$el
.
find
(
'
#pending-xmpp-contacts
'
),
$count
,
presence_change
;
// TODO see if user_id would be useful
var
user_id
=
Strophe
.
getNodeFromJid
(
item
.
id
),
view
=
this
.
rosteritemviews
[
item
.
id
],
ask
=
item
.
get
(
'
ask
'
),
subscription
=
item
.
get
(
'
subscription
'
),
crit
=
{
order
:
'
asc
'
};
var
jid
=
item
.
id
,
user_id
=
Strophe
.
getNodeFromJid
(
jid
),
view
=
this
.
rosteritemviews
[
item
.
id
],
ask
=
item
.
get
(
'
ask
'
),
subscription
=
item
.
get
(
'
subscription
'
),
crit
=
{
order
:
'
asc
'
};
if
(
ask
===
'
subscribe
'
)
{
$pending_contacts
.
after
(
view
.
render
().
el
);
...
...
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