fixed snarlnetwork

This commit is contained in:
Patrick von Reth 2011-01-02 01:47:59 +01:00
parent d4a32756e5
commit 93ac5e13fb
2 changed files with 5 additions and 6 deletions

View File

@ -114,7 +114,7 @@ QStringList FreedesktopNotification_Frontend::GetCapabilities()
QString FreedesktopNotification_Frontend::GetServerInformation(QString& vendor, QString& version, QString& specVersion)
{
vendor = "Snore";
version = "0.01";
version = snore()->version();
specVersion = "0";
return "Snore";
}

View File

@ -74,17 +74,17 @@ void SnarlNetworkFrontend::handleMessages(){
if(s == "")
continue;
SnarlNotification noti=parser->parse(s,client);
notifications.insert(noti.notification->id(),noti);
if(!noti.vailid)
continue;
if(noti.notification->isNotification()){
snore()->broadcastNotification(noti.notification);
if(noti.notification->id()!=0){
out+="/"+QString::number(noti.notification->id())+"\r\n";
out+="/"+QString::number(noti.notification->id());
notifications.insert(noti.notification->id(),noti);
}
}else{
out+="\r\n";
}
out+="\r\n";
client->write(out.toLatin1());
if(noti.httpClient){
client->disconnectFromHost();
@ -95,7 +95,6 @@ void SnarlNetworkFrontend::handleMessages(){
}
void SnarlNetworkFrontend::callback(const SnarlNotification &sn,QString msg){
qDebug()<<"SnarlNetwork callback:"<<sn.notification->id();
notifications.remove(sn.notification->id());
if(sn.clientSocket!=NULL&&!msg.isEmpty()){
msg+=QString::number(sn.notification->id());