From 847a3d5fc15217d90fa91e613c31805ad8b8f920 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Tue, 12 Feb 2013 23:22:45 +0100 Subject: [PATCH] =?UTF-8?q?warn=20when=20chat=20message=20didn=E2=80=99t?= =?UTF-8?q?=20make=20it=20but=20the=20server=20actually=20send=20a=20respo?= =?UTF-8?q?nse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/chat.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/chat.js b/code/chat.js index ac3da081..808b198f 100644 --- a/code/chat.js +++ b/code/chat.js @@ -685,11 +685,15 @@ window.chat.postMsg = function() { lngE6: Math.round(latlng.lng*1E6), factionOnly: !public}; + var errMsg = 'Your message could not be delivered. You can copy&' + + 'paste it here and try again if you want:\n\n' + msg; + window.postAjax('sendPlext', data, - function() { if(public) chat.requestNewPublic(); else chat.requestNewFaction(); }, + function(response) { + if(response.error) alert(errMsg); + if(public) chat.requestNewPublic(); else chat.requestNewFaction(); }, function() { - alert('Your message could not be delivered. You can copy&' + - 'paste it here and try again if you want:\n\n'+msg); + alert(errMsg); } );