diff options
Diffstat (limited to 'indra/newview/lleventnotifier.cpp')
| -rw-r--r-- | indra/newview/lleventnotifier.cpp | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index 343a572a6a..59f5cd342b 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -77,11 +77,11 @@ void LLEventNotifier::update() if (np->getEventDate() < (alert_time)) { - LLStringUtil::format_map_t args; - args["[NAME]"] = np->getEventName(); - args["[DATE]"] = np->getEventDateStr(); - LLNotifyBox::showXml("EventNotification", args, - notifyCallback, np); + LLSD args; + args["NAME"] = np->getEventName(); + args["DATE"] = np->getEventDateStr(); + LLNotifications::instance().add("EventNotification", args, LLSD(), + boost::bind(&LLEventNotification::handleResponse, np, _1, _2)); mEventNotifications.erase(iter++); } else @@ -173,47 +173,38 @@ void LLEventNotifier::remove(const U32 event_id) mEventNotifications.erase(iter); } -//static -void LLEventNotifier::notifyCallback(S32 option, void *user_data) +LLEventNotification::LLEventNotification() : + mEventID(0), + mEventName("") { - LLEventNotification *np = (LLEventNotification *)user_data; - if (!np) - { - llwarns << "Event notification callback without data!" << llendl; - return; - } +} + + +LLEventNotification::~LLEventNotification() +{ +} + +bool LLEventNotification::handleResponse(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); switch (option) { case 0: - gAgent.teleportViaLocation(np->getEventPosGlobal()); - gFloaterWorldMap->trackLocation(np->getEventPosGlobal()); + gAgent.teleportViaLocation(getEventPosGlobal()); + gFloaterWorldMap->trackLocation(getEventPosGlobal()); break; case 1: gDisplayEventHack = TRUE; - LLFloaterDirectory::showEvents(np->getEventID()); + LLFloaterDirectory::showEvents(getEventID()); break; case 2: break; } // We could clean up the notification on the server now if we really wanted to. + return false; } - - -LLEventNotification::LLEventNotification() : - mEventID(0), - mEventName(""), - mEventDate(0) -{ -} - - -LLEventNotification::~LLEventNotification() -{ -} - - BOOL LLEventNotification::load(const LLUserAuth::response_t &response) { |
