hi,
i do some change to rms plguin. can anyone submit to repository? thx
diff -Naur licq-1.2.7.orig/plugins/rms/src/rms.cpp licq-1.2.7/plugins/rms/src/rms.cpp --- licq-1.2.7.orig/plugins/rms/src/rms.cpp Mon Jun 23 02:25:50 2003 +++ licq-1.2.7/plugins/rms/src/rms.cpp Wed Jul 2 18:59:16 2003 @@ -47,6 +47,11 @@ const unsigned short CODE_VIEWxFLAGS = 221; const unsigned short CODE_VIEWxTEXTxSTART = 222; const unsigned short CODE_VIEWxTEXTxEND = 223; +const unsigned short CODE_ADDUSERxDONE = 224; +const unsigned short CODE_REMUSERxDONE = 225; +const unsigned short CODE_SECURExOPEN = 226; +const unsigned short CODE_SECURExCLOSE = 227; +const unsigned short CODE_SECURExSTAT = 228; const unsigned short CODE_VIEWxUNKNOWN = 299; // 300 - further action required const unsigned short CODE_ENTERxUIN = 300; @@ -64,6 +69,8 @@ const unsigned short CODE_EVENTxTIMEDOUT = 500; const unsigned short CODE_EVENTxFAILED = 501; const unsigned short CODE_EVENTxERROR = 502; +const unsigned short CODE_ADDUSERxERROR = 503; +const unsigned short CODE_SECURExNOTCOMPILED = 504; const unsigned short STATE_UIN = 1; const unsigned short STATE_PASSWORD = 2; @@ -82,7 +89,7 @@ char *help; }; -static const unsigned short NUM_COMMANDS = 12; +static const unsigned short NUM_COMMANDS = 15; static struct Command commands[NUM_COMMANDS] = { { "HELP", &CRMSClient::Process_HELP, @@ -108,7 +115,13 @@ { "VIEW", &CRMSClient::Process_VIEW, "View event (next or specific user) { [ <uin> ] }." }, { "AR", &CRMSClient::Process_AR, - "Set your (or a user custom) auto response { [ <uin> ] }." } + "Set your (or a user custom) auto response { [ <uin> ] }." }, + { "ADDUSER", &CRMSClient::Process_ADDUSER, + "Add user to contact list { <uin> }." }, + { "REMUSER", &CRMSClient::Process_REMUSER, + "Remove user from contact list { <uin> }." }, + { "SECURE", &CRMSClient::Process_SECURE, + "Open/close/check secure channel { <uin> [ <open|close> ] } ." } }; @@ -1132,4 +1145,126 @@ return fflush(fs); } +/*--------------------------------------------------------------------------- + * CRMSClient::Process_ADDUSER + * + * Command: + * ADDUSER <uin> + * + * Response: + * + *-------------------------------------------------------------------------*/ +int CRMSClient::Process_ADDUSER() +{ + unsigned long nUin = atol(data_arg); + + if (nUin >= 10000) + { + if (licqDaemon->AddUserToList(nUin)) + { + fprintf(fs, "%d User added\n", CODE_ADDUSERxDONE); + } + else + { + fprintf(fs, "%d User not added\n", CODE_ADDUSERxERROR); + } + } + else + { + fprintf(fs, "%d Invalid UIN.\n", CODE_INVALIDxUSER); + } + + return fflush(fs); +} + +/*--------------------------------------------------------------------------- + * CRMSClient::Process_REMUSER + * + * Command: + * REMUSER <uin> + * + * Response: + * + *-------------------------------------------------------------------------*/ +int CRMSClient::Process_REMUSER() +{ + unsigned long nUin = atol(data_arg); + + if (nUin >= 10000) + { + licqDaemon->RemoveUserFromList(nUin); + fprintf(fs, "%d User removed\n", CODE_REMUSERxDONE); + } + else + { + fprintf(fs, "%d Invalid UIN.\n", CODE_INVALIDxUSER); + } + + return fflush(fs); +} +/*--------------------------------------------------------------------------- + * CRMSClient::Process_SECURE + * + * Command: + * SECURE <uin> <what> + * + * Response: + * + *-------------------------------------------------------------------------*/ +int CRMSClient::Process_SECURE() +{ + unsigned long nUin = 0; + + if(!licqDaemon->CryptoEnabled()) + { + fprintf(fs, "%d Licq secure channel not compiled. Please recompile with OpenSSL.\n", CODE_SECURExNOTCOMPILED); + return fflush(fs); + } + + + if (isdigit(*data_arg)) + { + nUin = atol(data_arg); + while (*data_arg != '\0' && *data_arg != ' ') data_arg++; + NEXT_WORD(data_arg); + } + else + { + fprintf(fs, "%d Invalid UIN.\n", CODE_INVALIDxUSER); + return fflush(fs); + } + + if (nUin < 10000) + { + fprintf(fs, "%d Invalid UIN.\n", CODE_INVALIDxUSER); + return fflush(fs); + } + + if (strncasecmp(data_arg, "open", 4) == 0) + { + licqDaemon->icqOpenSecureChannel(nUin); + fprintf(fs, "%d Secure connection opened.\n", CODE_SECURExOPEN); + } + else + if (strncasecmp(data_arg, "close", 4) == 0) + { + licqDaemon->icqCloseSecureChannel(nUin); + fprintf(fs, "%d Secure connection closed.\n", CODE_SECURExCLOSE); + } + else + { + ICQUser *u = gUserManager.FetchUser(nUin,LOCK_R); + if (u->Secure()==0) + { + fprintf(fs, "%d Close\n", CODE_SECURExSTAT); + } + if (u->Secure()==1) + { + fprintf(fs, "%d Open\n", CODE_SECURExSTAT); + } + gUserManager.DropUser(u); + } + + return fflush(fs); +} diff -Naur licq-1.2.7.orig/plugins/rms/src/rms.h licq-1.2.7/plugins/rms/src/rms.h --- licq-1.2.7.orig/plugins/rms/src/rms.h Tue Sep 10 01:06:45 2002 +++ licq-1.2.7/plugins/rms/src/rms.h Wed Jul 2 18:43:25 2003 @@ -78,6 +78,9 @@ int Process_LOG(); int Process_VIEW(); int Process_AR(); + int Process_ADDUSER(); + int Process_REMUSER(); + int Process_SECURE(); protected: TCPSocket sock;