Fix son en boucle reception sms discussion
This commit is contained in:
parent
53fed0f740
commit
4688836b1a
|
@ -95,6 +95,7 @@
|
||||||
'date' => htmlspecialchars($received['at']),
|
'date' => htmlspecialchars($received['at']),
|
||||||
'text' => htmlspecialchars($received['content']),
|
'text' => htmlspecialchars($received['content']),
|
||||||
'type' => 'received',
|
'type' => 'received',
|
||||||
|
'md5' => md5($received),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,9 @@
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
|
|
||||||
|
var alreadyReceivedMessages = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cette fonction vérifie régulièrement les sms pour mettre à jour l'affichage
|
* Cette fonction vérifie régulièrement les sms pour mettre à jour l'affichage
|
||||||
*/
|
*/
|
||||||
|
@ -80,7 +83,13 @@
|
||||||
'<div class="discussion-message-date">' + message.date + '</div>' +
|
'<div class="discussion-message-date">' + message.date + '</div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
playReceptionSound();
|
|
||||||
|
if (alreadyReceivedMessages.indexOf(message.md5) == -1)
|
||||||
|
{
|
||||||
|
playReceptionSound();
|
||||||
|
alreadyReceivedMessages.push(message.md5);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'sended' :
|
case 'sended' :
|
||||||
var texte = '' +
|
var texte = '' +
|
||||||
|
|
Loading…
Reference in New Issue