summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-12-09 12:05:27 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-12-09 12:05:27 (GMT)
commit38862a78d119d4ac8cd8495436e75d00f3ee896e (patch)
treeea1e21878adde1bda829454049c73e92f1cab513 /src/game
parent6478ed121ce17cf7d7beaab2deb1953da63d283d (diff)
downloadpowder-38862a78d119d4ac8cd8495436e75d00f3ee896e.zip
powder-38862a78d119d4ac8cd8495436e75d00f3ee896e.tar.gz
New Conversation notifications
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GameController.cpp17
-rw-r--r--src/game/GameController.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 154d99b..188a233 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -1257,6 +1257,23 @@ void GameController::NotifyAuthUserChanged(Client * sender)
gameModel->SetUser(newUser);
}
+void GameController::NotifyNewNotification(Client * sender, std::pair<std::string, std::string> notification)
+{
+ class LinkNotification : public Notification
+ {
+ std::string link;
+ public:
+ LinkNotification(std::string link_, std::string message) : link(link_), Notification(message) {}
+ virtual ~LinkNotification() {}
+
+ virtual void Action()
+ {
+ OpenURI(link);
+ }
+ };
+ gameModel->AddNotification(new LinkNotification(notification.second, notification.first));
+}
+
void GameController::NotifyUpdateAvailable(Client * sender)
{
class UpdateConfirmation: public ConfirmDialogueCallback {
diff --git a/src/game/GameController.h b/src/game/GameController.h
index 984cfd6..d44a295 100644
--- a/src/game/GameController.h
+++ b/src/game/GameController.h
@@ -142,6 +142,7 @@ public:
virtual void NotifyUpdateAvailable(Client * sender);
virtual void NotifyAuthUserChanged(Client * sender);
+ virtual void NotifyNewNotification(Client * sender, std::pair<std::string, std::string> notification);
void RunUpdater();
};