Fix son en boucle reception sms discussion
This commit is contained in:
parent
53fed0f740
commit
4688836b1a
|
@ -95,6 +95,7 @@
|
|||
'date' => htmlspecialchars($received['at']),
|
||||
'text' => htmlspecialchars($received['content']),
|
||||
'type' => 'received',
|
||||
'md5' => md5($received),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,9 @@
|
|||
</div>
|
||||
<script>
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
var alreadyReceivedMessages = [];
|
||||
|
||||
/**
|
||||
* 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>' +
|
||||
'</div>';
|
||||
playReceptionSound();
|
||||
|
||||
if (alreadyReceivedMessages.indexOf(message.md5) == -1)
|
||||
{
|
||||
playReceptionSound();
|
||||
alreadyReceivedMessages.push(message.md5);
|
||||
}
|
||||
|
||||
break;
|
||||
case 'sended' :
|
||||
var texte = '' +
|
||||
|
|
Loading…
Reference in New Issue