Browse Source

forgot new message variable

causefx 7 years ago
parent
commit
3036a568c8
3 changed files with 4 additions and 3 deletions
  1. 1 1
      api/plugins/chat.php
  2. 1 0
      api/plugins/config/chat.php
  3. 2 2
      api/plugins/js/chat.js

+ 1 - 1
api/plugins/chat.php

@@ -71,7 +71,7 @@ function chatGetSettings()
 				'type' => 'select',
 				'name' => 'newMessageSound',
 				'label' => 'Message Sound',
-				'value' => $GLOBALS['newMessageSound'],
+				'value' => $GLOBALS['CHAT-newMessageSound-include'],
 				'options' => getSounds()
 			),
 		),

+ 1 - 0
api/plugins/config/chat.php

@@ -8,4 +8,5 @@ return array(
 	'CHAT-secret' => '',
 	'CHAT-messageLoadLimit' => '200',
 	'CHAT-userRefreshTimeout' => '60000',
+	'CHAT-newMessageSound-include' => 'plugins/sounds/default/newmessage.mp3',
 );

+ 2 - 2
api/plugins/js/chat.js

@@ -6,7 +6,7 @@ function chatLaunch(){
             chatLaunch();
         }, 1000);
     }else{
-        if(activeInfo.plugins["CHAT-enabled"] == true){
+        if(activeInfo.plugins["CHAT-enabled"] == true && activeInfo.plugins.includes["CHAT-authKey-include"] !== '' && activeInfo.plugins.includes["CHAT-appID-include"] !== '' && activeInfo.plugins.includes["CHAT-cluster-include"] !== ''){
             if (activeInfo.user.groupID <= activeInfo.plugins.includes["CHAT-Auth-include"]) {
                 var menuList = `<li><a class=""  onclick="tabActions(event,'chat','plugin');chatEntry();"><i class="fa fa-comments-o fa-fw"></i> <span lang="en">Chat</span><small class="chat-counter label label-rouded label-info pull-right hidden">0</small></a></li>`;
 				var htmlDOM = `
@@ -56,7 +56,7 @@ function chatLaunch(){
                         $('.custom-send').html('<button class="btn btn-info btn-rounded custom-send-button" type="button">Send</button>');
                         $(".chat-list").scrollTop($(".chat-list")[0].scrollHeight);
                         if($('#container-plugin-chat').hasClass('hidden')){
-                            var chatSound =  new Audio(activeInfo.settings.misc.newMessageSound);
+                            var chatSound =  new Audio(activeInfo.plugins.includes["CHAT-newMessageSound-include"]);
                             chatSound.play();
                             message(data.username,data.message,activeInfo.settings.notifications.position,"#FFF","success","20000");
                             $('.profile-image').addClass('animated loop-animation rubberBand');