mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Only sending namechange if userstarted, and fixed visual chat on mobile
This commit is contained in:
		| @@ -50,6 +50,10 @@ function namechange(data, guid, socket) { | ||||
|     if(!data.hasOwnProperty("name") || data.name.length > 10 || !data.hasOwnProperty("channel")) return; | ||||
|     var pw = ""; | ||||
|     var new_password; | ||||
|     var first = false; | ||||
|     if(data.hasOwnProperty("first")) { | ||||
|         first = data.first; | ||||
|     } | ||||
|     if(data.hasOwnProperty("password")) { | ||||
|         pw = data.password; | ||||
|         new_password = false; | ||||
| @@ -80,7 +84,7 @@ function namechange(data, guid, socket) { | ||||
|                 db.collection("user_names").update({"guid": guid}, {$set: {name: name}}, function(err, docs) { | ||||
|                     db.collection("user_names").update({"_id": "all_names"}, {$addToSet: {names: name}}, function(err, docs) { | ||||
|                         socket.emit('name', {type: "name", accepted: true}); | ||||
|                         if(old_name != name) { | ||||
|                         if(old_name != name && !first) { | ||||
|                             io.to(data.channel).emit('chat', {from: old_name, msg: " changed name to " + name}); | ||||
|                             io.sockets.emit('chat.all', {from: old_name , msg: " changed name to " + name, channel: data.channel}); | ||||
|                         } | ||||
|   | ||||
| @@ -117,7 +117,7 @@ | ||||
|   cursor:default; | ||||
| } | ||||
|  | ||||
| #chatPlaylist, #suggestions{ | ||||
| #chat-container, #suggestions{ | ||||
|   height:calc(100vh - 48px - 64px) !important; | ||||
| } | ||||
|  | ||||
| @@ -251,7 +251,7 @@ li.disabled span { | ||||
|   display: none; | ||||
| } | ||||
|  | ||||
| #chatPlaylist{ | ||||
| #chat-container{ | ||||
|   overflow: hidden; | ||||
| } | ||||
|  | ||||
| @@ -1807,6 +1807,10 @@ nav ul li:hover, nav ul li.active { | ||||
|     opacity:0.8; | ||||
| } | ||||
|  | ||||
| #suggestions { | ||||
|   padding-bottom: 20px; | ||||
| } | ||||
|  | ||||
| .tabs_height{ | ||||
|   height:calc(100vh - 48px - 64px - 32px) !important; | ||||
|   overflow:auto; | ||||
| @@ -2304,6 +2308,15 @@ nav ul li:hover, nav ul li.active { | ||||
|       margin-top:25px !important; | ||||
|     } | ||||
|  | ||||
|     #suggestions { | ||||
|       height: auto !important; | ||||
|       padding-bottom: 0px; | ||||
|     } | ||||
|  | ||||
|     #chat-container { | ||||
|       height: calc(100vh - 48px - 64px - 120px) !important; | ||||
|     } | ||||
|  | ||||
|     .mobile-delete { | ||||
|       height: 100%; | ||||
|       position: absolute; | ||||
| @@ -2482,7 +2495,7 @@ nav ul li:hover, nav ul li.active { | ||||
|       pointer-events: all; | ||||
|     } | ||||
|  | ||||
|     #chatPlaylist { | ||||
|     #chat-container { | ||||
|       padding-left: 10px; | ||||
|     } | ||||
|  | ||||
| @@ -2559,6 +2572,8 @@ nav ul li:hover, nav ul li.active { | ||||
|     #volume-button{ | ||||
|       float: right; | ||||
|       margin-right: 5px; | ||||
|       height: 51px; | ||||
|       padding-top: 0px; | ||||
|     } | ||||
|  | ||||
|     #fullscreen{ | ||||
|   | ||||
							
								
								
									
										2
									
								
								server/public/assets/dist/embed.min.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								server/public/assets/dist/embed.min.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								server/public/assets/dist/main.min.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								server/public/assets/dist/main.min.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -4,7 +4,7 @@ var Chat = { | ||||
|     all_received: 0, | ||||
|     chat_help: ["/name <new name> <password> to register and save a password for a nickname", "/name <new name> <new_password> <old_password> to change the password on a nickname", "/removename to logout"],//, "There are no commands.. As of now!"], | ||||
|  | ||||
|     namechange: function(data) { | ||||
|     namechange: function(data, first) { | ||||
|         var input = data.split(" "); | ||||
|         if(input.length == 2) { | ||||
|             var name = input[0]; | ||||
| @@ -12,7 +12,7 @@ var Chat = { | ||||
|             temp_name = name; | ||||
|             temp_pass = password; | ||||
|             password = Crypt.crypt_pass(password); | ||||
|             socket.emit("namechange", {name: name, channel: chan.toLowerCase(), password: password}); | ||||
|             socket.emit("namechange", {name: name, channel: chan.toLowerCase(), password: password, first: first}); | ||||
|         } else if(input.length == 3) { | ||||
|             var name = input[0]; | ||||
|             var new_password = input[1]; | ||||
| @@ -38,7 +38,7 @@ var Chat = { | ||||
|     chat: function(data) { | ||||
|         if(data.value.length > 150) return; | ||||
|         if(data.value.startsWith("/name ")){ | ||||
|             Chat.namechange(data.value.substring(6)); | ||||
|             Chat.namechange(data.value.substring(6), false); | ||||
|         } else if(data.value.startsWith("/help")) { | ||||
|             if($(".chat-tab-li a.active").attr("href") == "#all_chat"){ | ||||
|                 if($("#chatall").children().length > 100) { | ||||
|   | ||||
| @@ -31,7 +31,7 @@ var Crypt = { | ||||
|             if(conf_arr.width != 100) Player.set_width(conf_arr.width); | ||||
|             if(conf_arr.name !== undefined && conf_arr.name !== "" && conf_arr.chat_pass !== undefined && conf_arr.chat_pass !== ""){ | ||||
|                 setTimeout(function() { | ||||
|                     Chat.namechange(conf_arr.name + " " + conf_arr.chat_pass); | ||||
|                     Chat.namechange(conf_arr.name + " " + conf_arr.chat_pass, true); | ||||
|                 }, 100); //to take height for delay on establishing connection | ||||
|             } | ||||
|         } | ||||
|   | ||||
| @@ -682,9 +682,9 @@ var List = { | ||||
|             async: true, | ||||
|             statusCode: { | ||||
|                 429: function(jqXHR) { | ||||
|                     console.log(jqXHR.getAllResponseHeaders()); | ||||
|                     Helper.log(jqXHR.getAllResponseHeaders()); | ||||
|                     var retryAfter = jqXHR.getResponseHeader("Retry-After"); | ||||
|                     console.log(retryAfter); | ||||
|                     Helper.log(retryAfter); | ||||
|                     if (!retryAfter) retryAfter = 5; | ||||
|                     retryAfter = parseInt(retryAfter, 10); | ||||
|                     Helper.log("Retry-After", retryAfter); | ||||
| @@ -695,9 +695,9 @@ var List = { | ||||
|             }, | ||||
|             error: function(err){ | ||||
|                 if(err.status == 429){ | ||||
|                     console.log(err.getAllResponseHeaders()); | ||||
|                     Helper.log(err.getAllResponseHeaders()); | ||||
|                     var retryAfter = err.getResponseHeader("Retry-After"); | ||||
|                     console.log(retryAfter); | ||||
|                     Helper.log(retryAfter); | ||||
|                     if (!retryAfter) retryAfter = 5; | ||||
|                     retryAfter = parseInt(retryAfter, 10); | ||||
|                     Helper.log("Retry-After", retryAfter); | ||||
|   | ||||
| @@ -157,7 +157,7 @@ $().ready(function(){ | ||||
|                 } | ||||
|                 if(chan != undefined && conf_arr.name !== undefined && conf_arr.name !== "" && conf_arr.chat_pass !== undefined && conf_arr.chat_pass !== ""){ | ||||
|                     setTimeout(function() { | ||||
|                         Chat.namechange(conf_arr.name + " " + conf_arr.chat_pass); | ||||
|                         Chat.namechange(conf_arr.name + " " + conf_arr.chat_pass, true); | ||||
|                     }, 100); //to take height for delay on establishing connection | ||||
|                 } | ||||
|             }); | ||||
| @@ -1525,7 +1525,7 @@ $(document).on("click", ".chat-link", function(e){ | ||||
|     $(".chat-link").attr("style", "color: white !important;"); | ||||
|     blinking = false; | ||||
|     $("#favicon").attr("href", "/assets/images/favicon.png"); | ||||
|     $("#chatPlaylist").css("display", "block"); | ||||
|     $("#chat-container").css("display", "block"); | ||||
|     $("#wrapper").css("display", "none"); | ||||
|     $("#suggestions").css("display", "none"); | ||||
|     $("#text-chat-input").focus(); | ||||
| @@ -1534,7 +1534,7 @@ $(document).on("click", ".chat-link", function(e){ | ||||
|  | ||||
| $(document).on("click", ".playlist-link", function(e){ | ||||
|     chat_active = false; | ||||
|     $("#chatPlaylist").css("display", "none"); | ||||
|     $("#chat-container").css("display", "none"); | ||||
|     $("#wrapper").css("display", "block"); | ||||
|     $("#suggestions").css("display", "none"); | ||||
|     $("#pageButtons").css("display", "flex"); | ||||
| @@ -1542,7 +1542,7 @@ $(document).on("click", ".playlist-link", function(e){ | ||||
|  | ||||
| $(document).on("click", ".suggested-link", function(e){ | ||||
|     chat_active = false; | ||||
|     $("#chatPlaylist").css("display", "none"); | ||||
|     $("#chat-container").css("display", "none"); | ||||
|     $("#wrapper").css("display", "none"); | ||||
|     $("#suggestions").css("display", "block"); | ||||
|     $("#pageButtons").css("display", "none"); | ||||
|   | ||||
| @@ -286,7 +286,7 @@ | ||||
|     <div class="suggest_bar" id="user-suggest-html"> | ||||
|     </div> | ||||
| </div> | ||||
| <div id="chatPlaylist" class="tabs_height" style="display:none;"> | ||||
| <div id="chat-container" class="tabs_height" style="display:none;"> | ||||
|     <ul class="" id="chat-bar"> | ||||
|         <li id="chat-log"> | ||||
|             <ul class="inherit-height"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user