void onHub_OutgoingMessage(dcpp::interfaces::Hub* h, dcpp::interfaces::ChatMessage* cm, bool& handled) throw() { if(!handled) { if(cm->getReplyTo() == 0) { // hub message MakeCall("dcpp", "OnCommandEnter", 1, h, (const char*)cm->getText()); handled = GetLuaBool(); } else { // private message /*dcppChatMessage* cm = (dcppChatMessage*)p1; if(!cm || !cm->replyTo) return DCPP_FALSE; //bool isAdc = strncmp(url, "adc://", 6) == 0 || strncmp(url, "adcs://", 7) == 0; dcppBuffer buf = { 0 }; buf.buf = new char[40]; buf.size = 40; memset(buf.buf, 0, (size_t)buf.size); LuaManager::dcppLib->call(DCPP_CALL_USER_GET_CID, cm->replyTo, (dcpp_param)&buf, 0); MakeCall("dcpp", cm->incoming ? "OnPrivateMessageIn" : "OnPrivateMessageOut", 1, (const char*)buf.buf, cm->message); delete buf.buf; return GetLuaBool() ? DCPP_TRUE : DCPP_FALSE;*/ } } }
void onHub_IncomingCommand(dcpp::interfaces::Hub* h, const char* line, bool& handled) throw() { if(!handled) { bool isAdc = strncmp(h->getHubURL(), "adc://", 6) == 0 || strncmp(h->getHubURL(), "adcs://", 7) == 0; MakeCall((isAdc ? "adch" : "nmdch"), "DataArrival", 1, h, line); handled = GetLuaBool(); } }
void onUserConnection_OutgoingLine(dcpp::interfaces::UserConnection* uc, const char* line, bool& handled) throw() { if(!handled) { MakeCall("dcpp", "UserDataOut", 1, uc, line); handled = GetLuaBool(); } }
bool UserConnectionScriptInstance::onUserConnectionMessageOut(UserConnection* aConn, const string& aLine) { Lock l(cs); MakeCall("dcpp", "UserDataOut", 1, aConn, aLine); return GetLuaBool(); }
bool ClientScriptInstance::onHubFrameEnter(Client* aClient, const string& aLine) { Lock l(cs); // ditto the comment above MakeCall("dcpp", "OnCommandEnter", 1, aClient, aLine); return GetLuaBool(); }