{
int i = codes.indexOf("authenticate");
- QString pin = codes.mid(i+10);
+ QString pin = codes.mid(i+13);
pin = pin.trimmed();
if(!auth->authorize(prefix, pin))
irc->respond(sender,"failed");
+ qDebug()<<sender;
}
else if(codes.startsWith("bluemonkey"))
irc->respond(sender, "denied");
return;
}
+
+ QString bm("bluemonkey");
+
+ codes = codes.mid(bm.length()+1);
+
irc->respond(sender, engine->evaluate(codes).toString());
}
});
routingEngine->getPropertyAsync(request);
}
+
+void Property::propertyChanged(VehicleProperty::Property property, AbstractPropertyType *value, string uuid)
+{
+ mValue = value->copy();
+
+ changed(gvariantToQVariant(mValue->toVariant()));
+}
virtual PropertyList subscriptions() { PropertyList list; list.push_back(type().toStdString()); return list; }
virtual void supportedChanged(PropertyList ){ }
- virtual void propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, std::string uuid)
- {
- mValue = value->copy();
-
- QJsonDocument doc;
-
- doc.fromJson(mValue->toString().c_str());
-
- changed(doc.toVariant());
- }
+ virtual void propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, std::string uuid);
virtual std::string uuid() { return amb::createUuid(); }
void IrcCommunication::respond(QString target, QString s)
{
- IrcCommand command;
- command.setType(IrcCommand::Message);
- command.setParameters(QStringList()<<target<<s);
- session->sendCommand(&command);
+ IrcCommand *command = IrcCommand::createMessage(target,s);
+ session->sendCommand(command);
+
+ delete command;
+
}
void IrcCommunication::messageReceived(IrcMessage *msg)
QString sender = msg->parameters().at(0);
QString m = msg->parameters().at(1);
- message(sender,msg->sender().prefix(),m);
+ message(sender, msg->sender().prefix(), m);
}
}