summaryrefslogtreecommitdiff
path: root/src/gui/partywindow.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-28 18:13:57 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-28 18:13:57 -0600
commit088c0e4680d8013f01bdc70ac4f340f98afa2394 (patch)
treed3a103c962d8c8569bfab982882953e91326da65 /src/gui/partywindow.cpp
parentd7ffc90de680965edef7aa432d3bc3fd15986850 (diff)
downloadmana-client-088c0e4680d8013f01bdc70ac4f340f98afa2394.tar.gz
mana-client-088c0e4680d8013f01bdc70ac4f340f98afa2394.tar.bz2
mana-client-088c0e4680d8013f01bdc70ac4f340f98afa2394.tar.xz
mana-client-088c0e4680d8013f01bdc70ac4f340f98afa2394.zip
Clean up eAthena party handling a bit more
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 = "";
}
}