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
a1f68ff4
Commit
a1f68ff4
authored
Jan 11, 2018
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
e5c5ea10
f8bcdad8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
28 deletions
+24
-28
package-lock.json
package-lock.json
+3
-1
package.json
package.json
+1
-1
src/converse-chatview.js
src/converse-chatview.js
+8
-18
src/converse-mam.js
src/converse-mam.js
+12
-8
No files found.
package-lock.json
View file @
a1f68ff4
...
...
@@ -6825,7 +6825,9 @@
}
},
"pluggable.js"
:
{
"version"
:
"git+https://github.com/jcbrand/pluggable.js.git#a281e7207b62c5cc5fad084337fd32c003928e86"
,
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/pluggable.js/-/pluggable.js-2.0.0.tgz"
,
"integrity"
:
"sha512-FgrSayXWfQQWL+RSDiCAFZbkEsY7hTZCiSuN9Ar/mcHpesxOPfrSzJKp+YbimOt9QFtSd+lR8Uob5tgkdQSOzg=="
,
"dev"
:
true
,
"requires"
:
{
"lodash"
:
"4.17.4"
...
...
package.json
View file @
a1f68ff4
...
...
@@ -58,7 +58,7 @@
"
moment
"
:
"
~2.18.1
"
,
"
npm
"
:
"
^4.1.1
"
,
"
otr
"
:
"
0.2.16
"
,
"pluggable.js"
:
"
git+https://github.com/jcbrand/pluggable.js.git
"
,
"
pluggable.js
"
:
"
2.0.0
"
,
"
po2json
"
:
"
^0.4.4
"
,
"
requirejs
"
:
"
2.3.5
"
,
"
run-headless-chromium
"
:
"
^0.1.1
"
,
...
...
src/converse-chatview.js
View file @
a1f68ff4
...
...
@@ -419,11 +419,13 @@
}
},
isNotPermanentMessage
(
el
)
{
return
!
_
.
isNull
(
el
)
&&
(
u
.
hasClass
(
'
chat-event
'
,
el
)
||
!
u
.
hasClass
(
'
message
'
,
el
));
},
getPreviousMessageElement
(
el
)
{
let
prev_msg_el
=
el
.
previousSibling
;
while
(
!
_
.
isNull
(
prev_msg_el
)
&&
!
u
.
hasClass
(
'
message
'
,
prev_msg_el
)
&&
!
u
.
hasClass
(
'
chat-info
'
,
prev_msg_el
))
{
while
(
this
.
isNotPermanentMessage
(
prev_msg_el
))
{
prev_msg_el
=
prev_msg_el
.
previousSibling
}
return
prev_msg_el
;
...
...
@@ -431,9 +433,7 @@
getLastMessageElement
()
{
let
last_msg_el
=
this
.
content
.
lastElementChild
;
while
(
!
_
.
isNull
(
last_msg_el
)
&&
!
u
.
hasClass
(
'
message
'
,
last_msg_el
)
&&
!
u
.
hasClass
(
'
chat-info
'
,
last_msg_el
))
{
while
(
this
.
isNotPermanentMessage
(
last_msg_el
))
{
last_msg_el
=
last_msg_el
.
previousSibling
}
return
last_msg_el
;
...
...
@@ -441,9 +441,7 @@
getFirstMessageElement
()
{
let
first_msg_el
=
this
.
content
.
firstElementChild
;
while
(
!
_
.
isNull
(
first_msg_el
)
&&
!
u
.
hasClass
(
'
message
'
,
first_msg_el
)
&&
!
u
.
hasClass
(
'
chat-info
'
,
first_msg_el
))
{
while
(
this
.
isNotPermanentMessage
(
first_msg_el
))
{
first_msg_el
=
first_msg_el
.
nextSibling
}
return
first_msg_el
;
...
...
@@ -512,6 +510,7 @@
previous_msg_el
.
insertAdjacentElement
(
'
afterend
'
,
message_el
);
}
this
.
insertDayIndicator
(
message_el
);
this
.
clearStatusNotification
();
this
.
scrollDown
();
},
...
...
@@ -556,16 +555,7 @@
template
=
tpl_message
;
username
=
attrs
.
sender
===
'
me
'
&&
__
(
'
me
'
)
||
fullname
;
}
this
.
clearStatusNotification
();
if
(
text
.
length
>
8000
)
{
text
=
text
.
substring
(
0
,
10
)
+
'
...
'
;
this
.
showStatusNotification
(
__
(
"
A very large message has been received.
"
+
"
This might be due to an attack meant to degrade the chat performance.
"
+
"
Output has been shortened.
"
),
true
,
true
);
}
const
msg_time
=
moment
(
attrs
.
time
)
||
moment
;
const
msg
=
u
.
stringToElement
(
template
(
_
.
extend
(
this
.
getExtraMessageTemplateAttributes
(
attrs
),
{
...
...
src/converse-mam.js
View file @
a1f68ff4
...
...
@@ -78,15 +78,19 @@
(
result
)
=>
{
// Success
if
(
result
.
supported
)
{
const
most_recent_msg
=
utils
.
getMostRecentMessage
(
this
.
model
);
const
archive_id
=
most_recent_msg
.
get
(
'
archive_id
'
);
if
(
archive_id
)
{
this
.
fetchArchivedMessages
({
'
after
'
:
most_recent_msg
.
get
(
'
archive_id
'
)
});
if
(
_
.
isNil
(
most_recent_msg
))
{
this
.
fetchArchivedMessages
();
}
else
{
this
.
fetchArchivedMessages
({
'
start
'
:
most_recent_msg
.
get
(
'
time
'
)
});
const
archive_id
=
most_recent_msg
.
get
(
'
archive_id
'
);
if
(
archive_id
)
{
this
.
fetchArchivedMessages
({
'
after
'
:
most_recent_msg
.
get
(
'
archive_id
'
)
});
}
else
{
this
.
fetchArchivedMessages
({
'
start
'
:
most_recent_msg
.
get
(
'
time
'
)
});
}
}
}
else
{
this
.
clearSpinner
();
...
...
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