Browse Source

add placeholder emoticons.ini; check if there are emoticons loaded before trying to rewrite stuff

Andrew Dolgov 5 years ago
parent
commit
782af2354a
2 changed files with 4 additions and 1 deletions
  1. 3 0
      emoticons/emoticons.ini-dist
  2. 1 1
      js/tt-irc.js

+ 3 - 0
emoticons/emoticons.ini-dist

@@ -0,0 +1,3 @@
+[emoticons]
+;:emoticon:=emoticon.png,24
+;24 = image height in px

+ 1 - 1
js/tt-irc.js

@@ -2082,7 +2082,7 @@ function rewrite_emoticons(str) {
 		if (!str) return "";
 		if (get_cookie('ttirc_emoticons') == "false") return str;
 
-		if (emoticons_map) {
+		if (emoticons_map && emoticons_map.size() > 0) {
 			for (key in emoticons_map) {
 				str = str.replace(
 						new RegExp("" + RegExp.escape(key) + "", "g"),