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
5ffb09bd
Commit
5ffb09bd
authored
Apr 27, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates #161: Treat sent files also as oob messages
parent
ab09379a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
spec/http-file-upload.js
spec/http-file-upload.js
+10
-7
src/converse-chatboxes.js
src/converse-chatboxes.js
+1
-0
No files found.
spec/http-file-upload.js
View file @
5ffb09bd
...
@@ -337,6 +337,7 @@
...
@@ -337,6 +337,7 @@
expect
(
view
.
el
.
querySelector
(
'
.chat-content progress
'
).
getAttribute
(
'
value
'
)).
toBe
(
'
1
'
);
expect
(
view
.
el
.
querySelector
(
'
.chat-content progress
'
).
getAttribute
(
'
value
'
)).
toBe
(
'
1
'
);
message
.
save
({
message
.
save
({
'
upload
'
:
_converse
.
SUCCESS
,
'
upload
'
:
_converse
.
SUCCESS
,
'
oob_url
'
:
message
.
get
(
'
get
'
),
'
message
'
:
message
.
get
(
'
get
'
)
'
message
'
:
message
.
get
(
'
get
'
)
});
});
});
});
...
@@ -365,9 +366,10 @@
...
@@ -365,9 +366,10 @@
},
1000
);
},
1000
);
}).
then
(
function
()
{
}).
then
(
function
()
{
// Check that the image renders
// Check that the image renders
expect
(
view
.
el
.
querySelector
(
'
.chat-message .chat-msg-content
'
).
innerHTML
).
toEqual
(
expect
(
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg-media
'
).
innerHTML
.
trim
()).
toEqual
(
'
<a target="_blank" rel="noopener" href="http://localhost:8000/logo/conversejs-filled.svg">
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<img class="chat-image" src="http://localhost:8000/logo/conversejs-filled.svg"></a>
'
)
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg">
'
+
'
</a>
'
);
XMLHttpRequest
.
prototype
.
send
=
send_backup
;
XMLHttpRequest
.
prototype
.
send
=
send_backup
;
done
();
done
();
});
});
...
@@ -442,6 +444,7 @@
...
@@ -442,6 +444,7 @@
expect
(
view
.
el
.
querySelector
(
'
.chat-content progress
'
).
getAttribute
(
'
value
'
)).
toBe
(
'
1
'
);
expect
(
view
.
el
.
querySelector
(
'
.chat-content progress
'
).
getAttribute
(
'
value
'
)).
toBe
(
'
1
'
);
message
.
save
({
message
.
save
({
'
upload
'
:
_converse
.
SUCCESS
,
'
upload
'
:
_converse
.
SUCCESS
,
'
oob_url
'
:
message
.
get
(
'
get
'
),
'
message
'
:
message
.
get
(
'
get
'
)
'
message
'
:
message
.
get
(
'
get
'
)
});
});
});
});
...
@@ -470,9 +473,9 @@
...
@@ -470,9 +473,9 @@
},
1000
);
},
1000
);
}).
then
(
function
()
{
}).
then
(
function
()
{
// Check that the image renders
// Check that the image renders
expect
(
view
.
el
.
querySelector
(
'
.chat-m
essage .chat-msg-content
'
).
innerHTML
).
toEqual
(
expect
(
view
.
el
.
querySelector
(
'
.chat-m
sg .chat-msg-media
'
).
innerHTML
.
trim
()
).
toEqual
(
'
<a
target="_blank" rel="noopener" href="http://localhost:8000/logo/conversejs-filled.svg
">
'
+
'
<a
href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener
">
'
+
'
<img class="chat-image" src="http://localhost:8000/logo/conversejs-filled.svg"></a>
'
)
'
<img class="chat-image
img-thumbnail
" src="http://localhost:8000/logo/conversejs-filled.svg"></a>
'
)
XMLHttpRequest
.
prototype
.
send
=
send_backup
;
XMLHttpRequest
.
prototype
.
send
=
send_backup
;
done
();
done
();
});
});
...
@@ -680,7 +683,7 @@
...
@@ -680,7 +683,7 @@
expect
(
view
.
el
.
querySelector
(
'
.chat-content progress
'
).
getAttribute
(
'
value
'
)).
toBe
(
'
0.5
'
);
expect
(
view
.
el
.
querySelector
(
'
.chat-content progress
'
).
getAttribute
(
'
value
'
)).
toBe
(
'
0.5
'
);
message
.
set
(
'
progress
'
,
1
);
message
.
set
(
'
progress
'
,
1
);
expect
(
view
.
el
.
querySelector
(
'
.chat-content progress
'
).
getAttribute
(
'
value
'
)).
toBe
(
'
1
'
);
expect
(
view
.
el
.
querySelector
(
'
.chat-content progress
'
).
getAttribute
(
'
value
'
)).
toBe
(
'
1
'
);
expect
(
view
.
el
.
querySelector
(
'
.chat-content .chat-msg-
conten
t
'
).
textContent
).
toBe
(
'
Uploading file: my-juliet.jpg, 22.91 KB
'
);
expect
(
view
.
el
.
querySelector
(
'
.chat-content .chat-msg-
tex
t
'
).
textContent
).
toBe
(
'
Uploading file: my-juliet.jpg, 22.91 KB
'
);
done
();
done
();
});
});
var
sent_stanza
;
var
sent_stanza
;
...
...
src/converse-chatboxes.js
View file @
5ffb09bd
...
@@ -148,6 +148,7 @@
...
@@ -148,6 +148,7 @@
if
(
xhr
.
status
===
200
||
xhr
.
status
===
201
)
{
if
(
xhr
.
status
===
200
||
xhr
.
status
===
201
)
{
this
.
save
({
this
.
save
({
'
upload
'
:
_converse
.
SUCCESS
,
'
upload
'
:
_converse
.
SUCCESS
,
'
oob_url
'
:
this
.
get
(
'
get
'
),
'
message
'
:
this
.
get
(
'
get
'
)
'
message
'
:
this
.
get
(
'
get
'
)
});
});
}
else
{
}
else
{
...
...
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