refactor emote code to have withEmote in one place.
This commit is contained in:
parent
b679412cb0
commit
76959c3b2a
|
@ -146,22 +146,22 @@ function chatsubmit_click(game_id, parent_element) {
|
||||||
// TODO support an /ignore command
|
// TODO support an /ignore command
|
||||||
case '':
|
case '':
|
||||||
if (game_id !== null) {
|
if (game_id !== null) {
|
||||||
ajax = cah.Ajax.build(cah.$.AjaxOperation.GAME_CHAT).withGameId(game_id).withEmote(false);
|
ajax = cah.Ajax.build(cah.$.AjaxOperation.GAME_CHAT).withGameId(game_id);
|
||||||
} else {
|
} else {
|
||||||
ajax = cah.Ajax.build(cah.$.AjaxOperation.CHAT).withEmote(false);
|
ajax = cah.Ajax.build(cah.$.AjaxOperation.CHAT);
|
||||||
}
|
}
|
||||||
ajax = ajax.withMessage(text);
|
ajax = ajax.withEmote(false).withMessage(text);
|
||||||
cah.log.status_with_game(game_id, "<" + cah.nickname + "> " + text);
|
cah.log.status_with_game(game_id, "<" + cah.nickname + "> " + text);
|
||||||
break;
|
break;
|
||||||
case 'me':
|
case 'me':
|
||||||
if (game_id !== null) {
|
if (game_id !== null) {
|
||||||
ajax = cah.Ajax.build(cah.$.AjaxOperation.GAME_CHAT).withGameId(game_id).withEmote(true);
|
ajax = cah.Ajax.build(cah.$.AjaxOperation.GAME_CHAT).withGameId(game_id);
|
||||||
} else {
|
} else {
|
||||||
ajax = cah.Ajax.build(cah.$.AjaxOperation.CHAT).withEmote(true);
|
ajax = cah.Ajax.build(cah.$.AjaxOperation.CHAT);
|
||||||
}
|
}
|
||||||
ajax = ajax.withMessage(text);
|
ajax = ajax.withEmote(true).withMessage(text);
|
||||||
cah.log.status_with_game(game_id, "* " + cah.nickname + " " + text);
|
cah.log.status_with_game(game_id, "* " + cah.nickname + " " + text);
|
||||||
break;
|
break;
|
||||||
case 'wall':
|
case 'wall':
|
||||||
ajax = cah.Ajax.build(cah.$.AjaxOperation.CHAT).withWall(true).withMessage(text);
|
ajax = cah.Ajax.build(cah.$.AjaxOperation.CHAT).withWall(true).withMessage(text);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue