warn when chat message didn’t make it but the server actually send a response

This commit is contained in:
Stefan Breunig
2013-02-12 23:22:45 +01:00
parent 139e06d86c
commit 847a3d5fc1

View File

@ -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);
}
);