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
6cab7fcc
Commit
6cab7fcc
authored
Apr 16, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing tests due to refactoring
updates #161
parent
b889637f
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
35 deletions
+34
-35
spec/chatbox.js
spec/chatbox.js
+20
-20
spec/otr.js
spec/otr.js
+2
-2
src/converse-chatview.js
src/converse-chatview.js
+0
-1
src/converse-otr.js
src/converse-otr.js
+12
-12
No files found.
spec/chatbox.js
View file @
6cab7fcc
This diff is collapsed.
Click to expand it.
spec/otr.js
View file @
6cab7fcc
...
...
@@ -85,7 +85,7 @@
test_utils
.
openChatBoxFor
(
_converse
,
contact_jid
);
var
chatview
=
_converse
.
chatboxviews
.
get
(
contact_jid
);
chatview
.
model
.
set
(
'
otr_status
'
,
UNVERIFIED
);
var
stanza
=
chatview
.
createMessageStanza
(
new
_converse
.
Message
({
message
:
'
hello world
'
}));
var
stanza
=
chatview
.
model
.
createMessageStanza
(
new
_converse
.
Message
({
message
:
'
hello world
'
}));
var
$hints
=
$
(
stanza
.
nodeTree
).
find
(
'
[xmlns="
'
+
Strophe
.
NS
.
HINTS
+
'
"]
'
);
expect
(
$hints
.
length
).
toBe
(
3
);
expect
(
$hints
.
get
(
0
).
tagName
).
toBe
(
'
no-store
'
);
...
...
@@ -111,7 +111,7 @@
var
chatbox
=
_converse
.
chatboxes
.
get
(
sender_jid
);
spyOn
(
_converse
.
connection
,
'
send
'
);
chatbox
.
set
(
'
otr_status
'
,
1
);
// Set OTR status to UNVERIFIED, to mock an encrypted session
chatbox
.
trigger
(
'
sendMessage
'
,
new
_converse
.
Message
({
message
:
msgtext
}));
chatbox
.
sendMessage
(
new
_converse
.
Message
({
'
message
'
:
msgtext
}));
var
$sent
=
$
(
_converse
.
connection
.
send
.
calls
.
argsFor
(
0
)[
0
].
tree
());
expect
(
$sent
.
find
(
'
body
'
).
siblings
(
'
private
'
).
length
).
toBe
(
1
);
expect
(
$sent
.
find
(
'
private
'
).
length
).
toBe
(
1
);
...
...
src/converse-chatview.js
View file @
6cab7fcc
...
...
@@ -623,7 +623,6 @@
username
=
attrs
.
sender
===
'
me
'
&&
__
(
'
me
'
)
||
fullname
;
template
=
attrs
.
is_spoiler
?
tpl_spoiler_message
:
tpl_message
;
}
text
=
u
.
geoUriToHttp
(
text
,
_converse
);
const
msg_time
=
moment
(
attrs
.
time
)
||
moment
;
...
...
src/converse-otr.js
View file @
6cab7fcc
...
...
@@ -71,6 +71,18 @@
}
},
createMessageStanza
()
{
const
stanza
=
this
.
__super__
.
createMessageStanza
.
apply
(
this
,
arguments
);
if
(
this
.
get
(
'
otr_status
'
)
!==
UNENCRYPTED
||
utils
.
isOTRMessage
(
stanza
.
nodeTree
))
{
// OTR messages aren't carbon copied
stanza
.
c
(
'
private
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
CARBONS
}).
up
()
.
c
(
'
no-store
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
HINTS
}).
up
()
.
c
(
'
no-permanent-store
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
HINTS
}).
up
()
.
c
(
'
no-copy
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
HINTS
});
}
return
stanza
;
},
shouldPlayNotification
(
$message
)
{
/* Don't play a notification if this is an OTR message but
* encryption is not yet set up. That would mean that the
...
...
@@ -271,18 +283,6 @@
}
},
createMessageStanza
()
{
const
stanza
=
this
.
__super__
.
createMessageStanza
.
apply
(
this
,
arguments
);
if
(
this
.
model
.
get
(
'
otr_status
'
)
!==
UNENCRYPTED
||
utils
.
isOTRMessage
(
stanza
.
nodeTree
))
{
// OTR messages aren't carbon copied
stanza
.
c
(
'
private
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
CARBONS
}).
up
()
.
c
(
'
no-store
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
HINTS
}).
up
()
.
c
(
'
no-permanent-store
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
HINTS
}).
up
()
.
c
(
'
no-copy
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
HINTS
});
}
return
stanza
;
},
parseMessageForCommands
(
text
)
{
const
{
_converse
}
=
this
.
__super__
;
const
match
=
text
.
replace
(
/^
\s
*/
,
""
).
match
(
/^
\/(
.*
)\s
*$/
);
...
...
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