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
2473fb13
Commit
2473fb13
authored
May 25, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
On 2nd thought, don't query the msg text
I'm afraid it might get very expensive.
parent
29c2a964
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
src/converse-muc.js
src/converse-muc.js
+9
-15
No files found.
src/converse-muc.js
View file @
2473fb13
...
@@ -839,22 +839,16 @@
...
@@ -839,22 +839,16 @@
resource
=
Strophe
.
getResourceFromJid
(
jid
),
resource
=
Strophe
.
getResourceFromJid
(
jid
),
sender
=
resource
&&
Strophe
.
unescapeNode
(
resource
)
||
''
,
sender
=
resource
&&
Strophe
.
unescapeNode
(
resource
)
||
''
,
subject
=
$message
.
children
(
'
subject
'
).
text
(),
subject
=
$message
.
children
(
'
subject
'
).
text
(),
text
=
$message
.
find
(
'
body
'
).
text
(),
dupes
=
msgid
&&
this
.
model
.
messages
.
filter
(
function
(
msg
)
{
collision
=
msgid
&&
this
.
model
.
messages
.
findWhere
({
'
msgid
'
:
msgid
});
// Find duplicates.
if
(
collision
)
{
// Some bots (like HAL in the prosody chatroom)
// We already have a message with this id stored.
// respond to commands with the same ID as the
// It might therefore be a duplicate, but we cannot yet be
// original message. So we also check the sender.
// 100% sure. Some bots (like HAL in the prosody
return
msg
.
get
(
'
msgid
'
)
===
msgid
&&
msg
.
get
(
'
fullname
'
)
===
sender
;
// chatroom) respond to commands with the same ID as
});
// the original message. We therefore also check whether
if
(
dupes
.
length
)
{
// the sender is the same and then lastly whether the
// message text is the same.
if
(
collision
.
get
(
'
fullname
'
)
===
sender
)
{
if
(
this
.
model
.
messages
.
findWhere
({
'
message
'
:
text
}))
{
return
true
;
return
true
;
}
}
}
}
if
(
subject
)
{
if
(
subject
)
{
this
.
$el
.
find
(
'
.chatroom-topic
'
).
text
(
subject
).
attr
(
'
title
'
,
subject
);
this
.
$el
.
find
(
'
.chatroom-topic
'
).
text
(
subject
).
attr
(
'
title
'
,
subject
);
// For translators: the %1$s and %2$s parts will get replaced by the user and topic text respectively
// For translators: the %1$s and %2$s parts will get replaced by the user and topic text respectively
...
...
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