summaryrefslogtreecommitdiff
path: root/src/gui/partywindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/partywindow.cpp')
-rw-r--r--src/gui/partywindow.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp
index 1f87b26f..f5cebdfd 100644
--- a/src/gui/partywindow.cpp
+++ b/src/gui/partywindow.cpp
@@ -24,9 +24,14 @@
#include "gui/widgets/avatar.h"
#include "gui/widgets/chattab.h"
+#ifdef TMWSERV_SUPPORT
#include "net/tmwserv/chatserver/party.h"
+#else
+#include "net/ea/party.h"
+#endif
#include "utils/gettext.h"
+#include "utils/strprintf.h"
PartyWindow::PartyWindow() : Window(_("Party"))
{
@@ -107,7 +112,8 @@ void PartyWindow::removePartyMember(const std::string &memberName)
}
}
-void PartyWindow::showPartyInvite(const std::string &inviter)
+void PartyWindow::showPartyInvite(const std::string &inviter,
+ const std::string &partyName)
{
// check there isnt already an invite showing
if (mPartyInviter != "")
@@ -117,8 +123,15 @@ void PartyWindow::showPartyInvite(const std::string &inviter)
return;
}
+ std::string msg;
// log invite
- std::string msg = inviter + " has invited you to join their party";
+ if (partyName.empty())
+ msg = strprintf("%s has invited you to join their party",
+ inviter.c_str());
+ else
+ msg = strprintf("%s has invited you to join the %s party",
+ inviter.c_str(), partyName.c_str());
+
localChatTab->chatLog(msg, BY_SERVER);
// show invite
@@ -136,11 +149,21 @@ void PartyWindow::action(const gcn::ActionEvent &event)
if (eventId == "yes")
{
localChatTab->chatLog("Accepted invite from " + mPartyInviter);
+#ifdef TMWSERV_SUPPORT
Net::ChatServer::Party::acceptInvite(mPartyInviter);
+#else
+ eAthena::Party::respondToInvite(true);
+#endif
mPartyInviter = "";
}
else if (eventId == "no")
{
+ localChatTab->chatLog("Rejected invite from " + mPartyInviter);
+#ifdef TMWSERV_SUPPORT
+ // TODO
+#else
+ eAthena::Party::respondToInvite(false);
+#endif
mPartyInviter = "";
}
}