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
2b88db81
Commit
2b88db81
authored
May 30, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't show "new messages" indicator for archived messages
parent
a050015e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
docs/CHANGES.md
docs/CHANGES.md
+2
-1
src/converse-chatview.js
src/converse-chatview.js
+4
-1
src/converse-core.js
src/converse-core.js
+7
-3
src/converse-mam.js
src/converse-mam.js
+4
-6
No files found.
docs/CHANGES.md
View file @
2b88db81
...
...
@@ -8,8 +8,9 @@
-
Chat bot messages don't appear when they have the same ids as their commands.
[jcbrand]
-
Updated onDisconnected method to fire disconnected event even if
`auto_reconnect = false`
. [kamranzafar]
-
Bugfix: MAM messages weren't being fetched oldest first. [jcbrand]
-
#553 Add processing hints to OTR messages [jcbrand]
-
#553
Add processing hints to chat state notifications [jcbrand]
-
Add processing hints to chat state notifications [jcbrand]
## 1.0.2 (2016-05-24)
...
...
src/converse-chatview.js
View file @
2b88db81
...
...
@@ -335,7 +335,10 @@
if
(
converse
.
windowState
===
'
blur
'
||
this
.
model
.
get
(
'
scrolled
'
,
true
))
{
converse
.
incrementMsgCounter
();
}
if
(
this
.
model
.
get
(
'
scrolled
'
,
true
))
{
if
(
!
message
.
get
(
'
archive_id
'
)
&&
this
.
model
.
get
(
'
scrolled
'
,
true
))
{
// Show "new messages" indicator if we're scrolled
// up, but only if the new message is not a MAM
// archived one.
this
.
$el
.
find
(
'
.new-msgs-indicator
'
).
removeClass
(
'
hidden
'
);
}
}
else
{
...
...
src/converse-core.js
View file @
2b88db81
...
...
@@ -1167,7 +1167,7 @@
});
},
createMessage
:
function
(
$message
,
$delay
,
original_stanza
)
{
getMessageAttributes
:
function
(
$message
,
$delay
,
original_stanza
)
{
$delay
=
$delay
||
$message
.
find
(
'
delay
'
);
var
body
=
$message
.
children
(
'
body
'
).
text
(),
delayed
=
$delay
.
length
>
0
,
...
...
@@ -1199,7 +1199,7 @@
}
else
{
sender
=
'
them
'
;
}
return
this
.
messages
.
create
(
{
return
{
chat_state
:
chat_state
,
delayed
:
delayed
,
fullname
:
fullname
,
...
...
@@ -1207,7 +1207,11 @@
msgid
:
$message
.
attr
(
'
id
'
),
sender
:
sender
,
time
:
time
});
};
},
createMessage
:
function
(
$message
,
$delay
,
original_stanza
)
{
return
this
.
messages
.
create
(
this
.
getMessageAttributes
.
apply
(
this
,
arguments
));
}
});
...
...
src/converse-mam.js
View file @
2b88db81
...
...
@@ -49,12 +49,10 @@
},
ChatBox
:
{
createMessage
:
function
(
$message
,
$delay
,
original_stanza
)
{
var
message
=
this
.
_super
.
createMessage
.
apply
(
this
,
arguments
);
message
.
save
({
archive_id
:
$
(
original_stanza
).
find
(
'
result[xmlns="
'
+
Strophe
.
NS
.
MAM
+
'
"]
'
).
attr
(
'
id
'
)
});
return
message
;
getMessageAttributes
:
function
(
$message
,
$delay
,
original_stanza
)
{
var
attrs
=
this
.
_super
.
getMessageAttributes
.
apply
(
this
,
arguments
);
attrs
.
archive_id
=
$
(
original_stanza
).
find
(
'
result[xmlns="
'
+
Strophe
.
NS
.
MAM
+
'
"]
'
).
attr
(
'
id
'
);
return
attrs
;
}
},
...
...
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