fixed crash

This commit is contained in:
Patrick von Reth 2014-01-13 11:18:00 +01:00
parent b9f72387d5
commit 19a89f9e47
1 changed files with 12 additions and 8 deletions

View File

@ -53,16 +53,20 @@ bool SnarlNetworkFrontend::init(SnoreCore *snore){
}
void SnarlNetworkFrontend::actionInvoked(Notification notification){
void SnarlNetworkFrontend::actionInvoked(Notification notification)
{
//TODO:fix callback
SnarlNotification sn=notifications.value(notification.id());
if(notification.actionInvoked().id() == 1 )
if(notifications.contains(notification.id()))
{
callback(sn,"SNP/1.1/304/Notification acknowledged/");
}
else if(notification.actionInvoked().id() == 2)
{
callback(sn,"SNP/1.1/302/Notification cancelled/");
SnarlNotification sn=notifications.value(notification.id());
if(notification.actionInvoked().id() == 1 )
{
callback(sn,"SNP/1.1/304/Notification acknowledged/");
}
else if(notification.actionInvoked().id() == 2)
{
callback(sn,"SNP/1.1/302/Notification cancelled/");
}
}
}
void SnarlNetworkFrontend::notificationClosed(Notification notification)