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
92a18780
Commit
92a18780
authored
Jun 24, 2012
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Override jarnxmpp.Presence.onlineCount to use the ChatPartners storage.
parent
e10256a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
chat.js
chat.js
+21
-1
No files found.
chat.js
View file @
92a18780
...
@@ -7,7 +7,8 @@ var helpers = (function (helpers) {
...
@@ -7,7 +7,8 @@ var helpers = (function (helpers) {
}
}
return
o
;
return
o
;
};
};
helpers
.
hash
=
function
(
str
)
{
helpers
.
hash
=
function
(
str
)
{
// FIXME
// FIXME
if
(
str
==
'
online-users-container
'
)
{
if
(
str
==
'
online-users-container
'
)
{
return
str
;
return
str
;
...
@@ -15,6 +16,17 @@ var helpers = (function (helpers) {
...
@@ -15,6 +16,17 @@ var helpers = (function (helpers) {
var
shaobj
=
new
jsSHA
(
str
);
var
shaobj
=
new
jsSHA
(
str
);
return
shaobj
.
getHash
(
"
HEX
"
);
return
shaobj
.
getHash
(
"
HEX
"
);
};
};
helpers
.
size
=
function
(
obj
)
{
var
size
=
0
,
key
;
for
(
key
in
obj
)
{
if
(
obj
.
hasOwnProperty
(
key
))
{
size
++
;
}
}
return
size
;
};
return
helpers
;
return
helpers
;
})(
helpers
||
{});
})(
helpers
||
{});
...
@@ -51,6 +63,10 @@ var xmppchat = (function (jarnxmpp, $, console) {
...
@@ -51,6 +63,10 @@ var xmppchat = (function (jarnxmpp, $, console) {
}
}
}
}
};
};
methods
.
getTotal
=
function
()
{
return
helpers
.
size
(
storage
);
};
return
methods
;
return
methods
;
})();
})();
...
@@ -121,6 +137,10 @@ var xmppchat = (function (jarnxmpp, $, console) {
...
@@ -121,6 +137,10 @@ var xmppchat = (function (jarnxmpp, $, console) {
xmppchat
.
connection
.
sendIQ
(
iq
,
this
.
handleCollectionRetrieval
,
this
.
handleError
);
xmppchat
.
connection
.
sendIQ
(
iq
,
this
.
handleCollectionRetrieval
,
this
.
handleError
);
};
};
ob
.
Presence
.
onlineCount
=
function
()
{
return
xmppchat
.
ChatPartners
.
getTotal
();
};
ob
.
Presence
.
sendPresence
=
function
(
type
)
{
ob
.
Presence
.
sendPresence
=
function
(
type
)
{
if
(
type
===
undefined
)
{
if
(
type
===
undefined
)
{
type
=
xmppchat
.
Storage
.
get
(
xmppchat
.
username
+
'
-xmpp-status
'
)
||
'
online
'
;
type
=
xmppchat
.
Storage
.
get
(
xmppchat
.
username
+
'
-xmpp-status
'
)
||
'
online
'
;
...
...
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