summaryrefslogtreecommitdiff
path: root/src/gui/socialwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/socialwindow.cpp')
-rw-r--r--src/gui/socialwindow.cpp59
1 files changed, 28 insertions, 31 deletions
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 098ecbc5..88cd5732 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -20,22 +20,19 @@
#include "gui/socialwindow.h"
-#include "beingmanager.h"
+#include "event.h"
#include "guild.h"
#include "localplayer.h"
#include "party.h"
-#include "player.h"
#include "gui/confirmdialog.h"
#include "gui/okdialog.h"
#include "gui/setup.h"
#include "gui/textdialog.h"
-#include "gui/theme.h"
#include "gui/widgets/avatarlistbox.h"
#include "gui/widgets/browserbox.h"
#include "gui/widgets/button.h"
-#include "gui/widgets/chattab.h"
#include "gui/widgets/container.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layouthelper.h"
@@ -49,6 +46,8 @@
#include "net/guildhandler.h"
#include "net/partyhandler.h"
+#include "resources/theme.h"
+
#include "utils/dtor.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -123,10 +122,9 @@ public:
std::string name = mInviteDialog->getText();
Net::getGuildHandler()->invite(mGuild->getId(), name);
- localChatTab->chatLog(strprintf(_("Invited user %s to guild %s."),
+ SERVER_NOTICE(strprintf(_("Invited user %s to guild %s."),
name.c_str(),
- mGuild->getName().c_str()),
- BY_SERVER);
+ mGuild->getName().c_str()))
mInviteDialog = NULL;
}
else if (event.getId() == "~do invite")
@@ -136,8 +134,8 @@ public:
else if (event.getId() == "yes")
{
Net::getGuildHandler()->leave(mGuild->getId());
- localChatTab->chatLog(strprintf(_("Guild %s quit requested."),
- mGuild->getName().c_str()), BY_SERVER);
+ SERVER_NOTICE(strprintf(_("Guild %s quit requested."),
+ mGuild->getName().c_str()))
mConfirmDialog = NULL;
}
else if (event.getId() == "~yes")
@@ -204,8 +202,8 @@ public:
std::string name = mInviteDialog->getText();
Net::getPartyHandler()->invite(name);
- localChatTab->chatLog(strprintf(_("Invited user %s to party."),
- name.c_str()), BY_SERVER);
+ SERVER_NOTICE(strprintf(_("Invited user %s to party."),
+ name.c_str()))
mInviteDialog = NULL;
}
else if (event.getId() == "~do invite")
@@ -215,8 +213,8 @@ public:
else if (event.getId() == "yes")
{
Net::getPartyHandler()->leave();
- localChatTab->chatLog(strprintf(_("Party %s quit requested."),
- mParty->getName().c_str()), BY_SERVER);
+ SERVER_NOTICE(strprintf(_("Party %s quit requested."),
+ mParty->getName().c_str()))
mConfirmDialog = NULL;
}
else if (event.getId() == "~yes")
@@ -440,14 +438,14 @@ void SocialWindow::action(const gcn::ActionEvent &event)
// check if they accepted the invite
if (eventId == "yes")
{
- localChatTab->chatLog(strprintf(_("Accepted party invite from %s."),
- mPartyInviter.c_str()));
+ SERVER_NOTICE(strprintf(_("Accepted party invite from %s."),
+ mPartyInviter.c_str()))
Net::getPartyHandler()->inviteResponse(mPartyInviter, true);
}
else if (eventId == "no")
{
- localChatTab->chatLog(strprintf(_("Rejected party invite from %s."),
- mPartyInviter.c_str()));
+ SERVER_NOTICE(strprintf(_("Rejected party invite from %s."),
+ mPartyInviter.c_str()))
Net::getPartyHandler()->inviteResponse(mPartyInviter, false);
}
@@ -459,14 +457,14 @@ void SocialWindow::action(const gcn::ActionEvent &event)
// check if they accepted the invite
if (eventId == "yes")
{
- localChatTab->chatLog(strprintf(_("Accepted guild invite from %s."),
- mPartyInviter.c_str()));
+ SERVER_NOTICE(strprintf(_("Accepted guild invite from %s."),
+ mPartyInviter.c_str()))
Net::getGuildHandler()->inviteResponse(mGuildInvited, true);
}
else if (eventId == "no")
{
- localChatTab->chatLog(strprintf(_("Rejected guild invite from %s."),
- mPartyInviter.c_str()));
+ SERVER_NOTICE(strprintf(_("Rejected guild invite from %s."),
+ mPartyInviter.c_str()))
Net::getGuildHandler()->inviteResponse(mGuildInvited, false);
}
@@ -499,8 +497,8 @@ void SocialWindow::action(const gcn::ActionEvent &event)
}
Net::getGuildHandler()->create(name);
- localChatTab->chatLog(strprintf(_("Creating guild called %s."),
- name.c_str()), BY_SERVER);
+ SERVER_NOTICE(strprintf(_("Creating guild called %s."),
+ name.c_str()))
mGuildCreateDialog = NULL;
}
@@ -519,8 +517,8 @@ void SocialWindow::action(const gcn::ActionEvent &event)
}
Net::getPartyHandler()->create(name);
- localChatTab->chatLog(strprintf(_("Creating party called %s."),
- name.c_str()), BY_SERVER);
+ SERVER_NOTICE(strprintf(_("Creating party called %s."),
+ name.c_str()));
mPartyCreateDialog = NULL;
}
@@ -545,14 +543,14 @@ void SocialWindow::showGuildInvite(const std::string &guildName,
// check there isnt already an invite showing
if (mGuildInvited != 0)
{
- localChatTab->chatLog(_("Received guild request, but one already "
- "exists."), BY_SERVER);
+ SERVER_NOTICE(_("Received guild request, but one already "
+ "exists."))
return;
}
std::string msg = strprintf(_("%s has invited you to join the guild %s."),
inviterName.c_str(), guildName.c_str());
- localChatTab->chatLog(msg, BY_SERVER);
+ SERVER_NOTICE(msg)
// show invite
mGuildAcceptDialog = new ConfirmDialog(_("Accept Guild Invite"), msg, this);
@@ -567,8 +565,7 @@ void SocialWindow::showPartyInvite(const std::string &partyName,
// check there isnt already an invite showing
if (mPartyInviter != "")
{
- localChatTab->chatLog(_("Received party request, but one already "
- "exists."), BY_SERVER);
+ SERVER_NOTICE(_("Received party request, but one already exists."))
return;
}
@@ -599,7 +596,7 @@ void SocialWindow::showPartyInvite(const std::string &partyName,
}
}
- localChatTab->chatLog(msg, BY_SERVER);
+ SERVER_NOTICE(msg)
// show invite
mPartyAcceptDialog = new ConfirmDialog(_("Accept Party Invite"), msg, this);