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
cc37d6a1
Commit
cc37d6a1
authored
Sep 13, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The xa chat state wasn't being handled properly
parent
f8cad74a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
12 deletions
+32
-12
converse.js
converse.js
+3
-1
fonticons/style.css
fonticons/style.css
+2
-1
spec/MainSpec.js
spec/MainSpec.js
+27
-10
No files found.
converse.js
View file @
cc37d6a1
...
...
@@ -1887,6 +1887,7 @@
'
online
'
:
__
(
'
This contact is online
'
),
'
offline
'
:
__
(
'
This contact is offline
'
),
'
unavailable
'
:
__
(
'
This contact is unavailable
'
),
'
xa
'
:
__
(
'
This contact is away for an extended period
'
),
'
away
'
:
__
(
'
This contact is away
'
)
}[
item
.
get
(
'
chat_status
'
)
||
'
offline
'
];
this
.
$el
.
html
(
this
.
template
(
...
...
@@ -2273,7 +2274,7 @@
}
changed_presence
=
view
.
model
.
changed
.
chat_status
;
if
(
changed_presence
)
{
this
.
sortRoster
(
changed_presence
)
this
.
sortRoster
(
changed_presence
)
;
sorted
=
true
;
}
if
(
item
.
get
(
'
is_last
'
))
{
...
...
@@ -2312,6 +2313,7 @@
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.
'
+
chat_status
).
tsort
(
'
a
'
,
{
order
:
'
asc
'
});
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.offline
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.unavailable
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.xa
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.away
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.dnd
'
));
$my_contacts
.
after
(
$my_contacts
.
siblings
(
'
dd.current-xmpp-contact.online
'
));
...
...
fonticons/style.css
View file @
cc37d6a1
...
...
@@ -28,7 +28,7 @@ Instead of a list of all class selectors,
you can use the generic selector below, but it's slower:
[class*="icon-"] {
*/
.icon-home
,
.icon-pencil
,
.icon-camera
,
.icon-camera-2
,
.icon-play
,
.icon-music
,
.icon-headphones
,
.icon-phone
,
.icon-phone-hang-up
,
.icon-address-book
,
.icon-notebook
,
.icon-envelop
,
.icon-pushpin
,
.icon-online
,
.icon-away
,
.icon-bubbles
,
.icon-bubbles-2
,
.icon-bubbles-3
,
.icon-user
,
.icon-users
,
.icon-quotes-left
,
.icon-spinner
,
.icon-search
,
.icon-cogs
,
.icon-wrench
,
.icon-unlocked
,
.icon-lock
,
.icon-lock-2
,
.icon-key
,
.icon-key-2
,
.icon-zoom-out
,
.icon-zoom-in
,
.icon-cog
,
.icon-remove
,
.icon-remove-2
,
.icon-eye
,
.icon-eye-blocked
,
.icon-attachment
,
.icon-globe
,
.icon-heart
,
.icon-happy
,
.icon-thumbs-up
,
.icon-smiley
,
.icon-tongue
,
.icon-sad
,
.icon-wink
,
.icon-wondering
,
.icon-confused
,
.icon-shocked
,
.icon-evil
,
.icon-angry
,
.icon-cool
,
.icon-grin
,
.icon-info
,
.icon-notification
,
.icon-warning
,
.icon-spell-check
,
.icon-volume-high
,
.icon-volume-medium
,
.icon-volume-low
,
.icon-volume-mute
,
.icon-volume-mute-2
,
.icon-volume-decrease
,
.icon-volume-increase
,
.icon-bold
,
.icon-underline
,
.icon-italic
,
.icon-strikethrough
,
.icon-new-tab
,
.icon-youtube
,
.icon-close
,
.icon-blocked
,
.icon-cancel-circle
,
.icon-minus
,
.icon-plus
,
.icon-checkbox-checked
,
.icon-checkbox-unchecked
,
.icon-checkbox-partial
,
.icon-radio-checked
,
.icon-radio-unchecked
,
.icon-room-info
,
.icon-newspaper
,
.icon-image
,
.icon-offline
,
.icon-unavailable
,
.icon-dnd
{
.icon-home
,
.icon-pencil
,
.icon-camera
,
.icon-camera-2
,
.icon-play
,
.icon-music
,
.icon-headphones
,
.icon-phone
,
.icon-phone-hang-up
,
.icon-address-book
,
.icon-notebook
,
.icon-envelop
,
.icon-pushpin
,
.icon-online
,
.icon-away
,
.icon-
xa
,
.icon-
bubbles
,
.icon-bubbles-2
,
.icon-bubbles-3
,
.icon-user
,
.icon-users
,
.icon-quotes-left
,
.icon-spinner
,
.icon-search
,
.icon-cogs
,
.icon-wrench
,
.icon-unlocked
,
.icon-lock
,
.icon-lock-2
,
.icon-key
,
.icon-key-2
,
.icon-zoom-out
,
.icon-zoom-in
,
.icon-cog
,
.icon-remove
,
.icon-remove-2
,
.icon-eye
,
.icon-eye-blocked
,
.icon-attachment
,
.icon-globe
,
.icon-heart
,
.icon-happy
,
.icon-thumbs-up
,
.icon-smiley
,
.icon-tongue
,
.icon-sad
,
.icon-wink
,
.icon-wondering
,
.icon-confused
,
.icon-shocked
,
.icon-evil
,
.icon-angry
,
.icon-cool
,
.icon-grin
,
.icon-info
,
.icon-notification
,
.icon-warning
,
.icon-spell-check
,
.icon-volume-high
,
.icon-volume-medium
,
.icon-volume-low
,
.icon-volume-mute
,
.icon-volume-mute-2
,
.icon-volume-decrease
,
.icon-volume-increase
,
.icon-bold
,
.icon-underline
,
.icon-italic
,
.icon-strikethrough
,
.icon-new-tab
,
.icon-youtube
,
.icon-close
,
.icon-blocked
,
.icon-cancel-circle
,
.icon-minus
,
.icon-plus
,
.icon-checkbox-checked
,
.icon-checkbox-unchecked
,
.icon-checkbox-partial
,
.icon-radio-checked
,
.icon-radio-unchecked
,
.icon-room-info
,
.icon-newspaper
,
.icon-image
,
.icon-offline
,
.icon-unavailable
,
.icon-dnd
{
font-family
:
'Converse-js'
;
speak
:
none
;
font-style
:
normal
;
...
...
@@ -287,6 +287,7 @@ you can use the generic selector below, but it's slower:
.icon-image
:before
{
content
:
"\2b14"
;
}
.icon-xa
:before
,
.icon-unavailable
:before
,
.icon-offline
:before
{
content
:
"\e002"
;
...
...
spec/MainSpec.js
View file @
cc37d6a1
...
...
@@ -17,7 +17,8 @@
var
cur_names
=
[
'
Max Frankfurter
'
,
'
Candice van der Knijff
'
,
'
Irini Vlastuin
'
,
'
Rinse Sommer
'
,
'
Annegreet Gomez
'
,
'
Robin Schook
'
,
'
Marcel Eberhardt
'
,
'
Simone Brauer
'
,
'
Asmaa Haakman
'
,
'
Felix Amsel
'
,
'
Lena Grunewald
'
,
'
Laura Grunewald
'
,
'
Mandy Seiler
'
,
'
Sven Bosch
'
,
'
Nuriye Cuypers
'
'
Lena Grunewald
'
,
'
Laura Grunewald
'
,
'
Mandy Seiler
'
,
'
Sven Bosch
'
,
'
Nuriye Cuypers
'
,
'
Staal Burger
'
,
'
Brenner Brand
'
,
'
Vleis Visagie
'
];
var
num_contacts
=
req_names
.
length
+
pend_names
.
length
+
cur_names
.
length
;
var
open_controlbox
;
...
...
@@ -280,10 +281,28 @@
}
},
converse
));
it
(
"
can change their status to
unavailable
and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
it
(
"
can change their status to
xa
and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
var
item
,
view
,
jid
,
t
;
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
for
(
i
=
9
;
i
<
12
;
i
++
)
{
jid
=
cur_names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
view
=
this
.
rosterview
.
rosteritemviews
[
jid
];
spyOn
(
view
,
'
render
'
).
andCallThrough
();
item
=
view
.
model
;
item
.
set
(
'
chat_status
'
,
'
xa
'
);
expect
(
view
.
render
).
toHaveBeenCalled
();
expect
(
this
.
rosterview
.
render
).
toHaveBeenCalled
();
// Check that they are sorted alphabetically
t
=
this
.
rosterview
.
$el
.
find
(
'
dt#xmpp-contacts
'
).
siblings
(
'
dd.current-xmpp-contact.xa
'
).
find
(
'
a.open-chat
'
).
text
();
expect
(
t
).
toEqual
(
cur_names
.
slice
(
9
,
i
+
1
).
sort
().
join
(
''
));
}
},
converse
));
it
(
"
can change their status to unavailable and be sorted alphabetically
"
,
$
.
proxy
(
function
()
{
var
item
,
view
,
jid
,
t
;
spyOn
(
this
.
rosterview
,
'
render
'
).
andCallThrough
();
for
(
i
=
12
;
i
<
15
;
i
++
)
{
jid
=
cur_names
[
i
].
replace
(
'
'
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
;
view
=
this
.
rosterview
.
rosteritemviews
[
jid
];
spyOn
(
view
,
'
render
'
).
andCallThrough
();
...
...
@@ -294,31 +313,29 @@
// Check that they are sorted alphabetically
t
=
this
.
rosterview
.
$el
.
find
(
'
dt#xmpp-contacts
'
).
siblings
(
'
dd.current-xmpp-contact.unavailable
'
).
find
(
'
a.open-chat
'
).
text
();
expect
(
t
).
toEqual
(
cur_names
.
slice
(
9
,
i
+
1
).
sort
().
join
(
''
));
expect
(
t
).
toEqual
(
cur_names
.
slice
(
12
,
i
+
1
).
sort
().
join
(
''
));
}
},
converse
));
it
(
"
are ordered according to status: online, busy, away, unavailable, offline
"
,
$
.
proxy
(
function
()
{
it
(
"
are ordered according to status: online, busy, away,
xa,
unavailable, offline
"
,
$
.
proxy
(
function
()
{
var
contacts
=
this
.
rosterview
.
$el
.
find
(
'
dd.current-xmpp-contact
'
);
var
i
;
// The first five contacts are online.
for
(
i
=
0
;
i
<
3
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
online
'
);
}
// The next five are busy
for
(
i
=
3
;
i
<
6
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
dnd
'
);
}
// The next five are away
for
(
i
=
6
;
i
<
9
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
away
'
);
}
// The next five are unavailable
for
(
i
=
9
;
i
<
12
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
xa
'
);
}
for
(
i
=
12
;
i
<
15
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
unavailable
'
);
}
// The next 20 are offline
for
(
i
=
12
;
i
<
cur_names
.
length
;
i
++
)
{
for
(
i
=
15
;
i
<
cur_names
.
length
;
i
++
)
{
expect
(
$
(
contacts
[
i
]).
attr
(
'
class
'
).
split
(
'
'
,
1
)[
0
]).
toEqual
(
'
offline
'
);
}
},
converse
));
...
...
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