summaryrefslogtreecommitdiff
path: root/src/commands.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-14 02:10:44 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-14 02:10:44 +0300
commitbb631b982a2f9b35e8009c3e76c4445ea3fda460 (patch)
treebb4d4924a6fc35e7168cecbe75dd1820287a5c58 /src/commands.cpp
parenteefb212caca31d46f1d36ce272d4bc6842c039f0 (diff)
downloadplus-bb631b982a2f9b35e8009c3e76c4445ea3fda460.tar.gz
plus-bb631b982a2f9b35e8009c3e76c4445ea3fda460.tar.bz2
plus-bb631b982a2f9b35e8009c3e76c4445ea3fda460.tar.xz
plus-bb631b982a2f9b35e8009c3e76c4445ea3fda460.zip
In no chat window present, show dialog message about uploaded file.
Diffstat (limited to 'src/commands.cpp')
-rw-r--r--src/commands.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 071b080a4..c8718127f 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -43,6 +43,7 @@
#include "gui/windows/buydialog.h"
#include "gui/windows/chatwindow.h"
#include "gui/windows/helpwindow.h"
+#include "gui/windows/okdialog.h"
#include "gui/windows/outfitwindow.h"
#include "gui/windows/shopwindow.h"
#include "gui/windows/socialwindow.h"
@@ -1324,20 +1325,26 @@ static int uploadUpdate(void *ptr,
UploadChatInfo *const info = reinterpret_cast<UploadChatInfo*>(ptr);
if (status == DownloadStatus::Complete)
{
- ChatTab *const tab = info->tab;
- if (chatWindow && (!tab || chatWindow->isTabPresent(tab)))
+ std::string str = Net::Download::getUploadResponse();
+ const size_t sz = str.size();
+ if (sz > 0)
{
- std::string str = Net::Download::getUploadResponse();
- const size_t sz = str.size();
- if (sz > 0)
+ if (str[sz - 1] == '\n')
+ str = str.substr(0, sz - 1);
+ str.append(info->addStr);
+ ChatTab *const tab = info->tab;
+ if (chatWindow && (!tab || chatWindow->isTabPresent(tab)))
{
- if (str[sz - 1] == '\n')
- str = str.substr(0, sz - 1);
- str.append(info->addStr);
str = strprintf("%s [@@%s |%s@@]",
info->text.c_str(), str.c_str(), str.c_str());
outStringNormal(tab, str, str);
}
+ else
+ {
+ // TRANSLATORS: file uploaded message
+ new OkDialog(_("File uploaded"), str,
+ DialogType::OK, true, false);
+ }
}
}
delete2(info->upload);