📄 sendmessageaction.java
字号:
//#sijapp cond.end# marker += 2; Util.putWord(buf, marker, 0x0000); marker += 2; Util.putDWord(buf, marker, messId); marker += 4; Util.putDWord(buf, marker, 0x00000000); marker += 4; System.arraycopy(Icq.CAP_AIM_SERVERRELAY, 0, buf, marker, 16); // SUB_MSG_TYPE2.CAPABILITY marker += 16; // Set TLV 0x0a to 0x0001 Util.putDWord(buf, marker, 0x000a0002); marker += 4; Util.putWord(buf, marker, 0x0001); marker += 2; // Set emtpy TLV 0x0f Util.putDWord(buf, marker, 0x000f0000); marker += 4;//#sijapp cond.if target!="DEFAULT" & modules_FILES="true"# if (this.fileTrans != null) { // Set TLV 0x03 (IP) Util.putWord(buf, marker, 0x0003); Util.putWord(buf, marker + 2, 0x0004); System.arraycopy(Icq.c.getLocalIP(), 0, buf, marker + 4, 4); marker += 8; // Set TLV 0x05 (port) Util.putWord(buf, marker, 0x0005); Util.putWord(buf, marker + 2, 0x0002); Util.putWord(buf, marker + 4, Icq.c.getLocalPort()); marker += 6; }//#sijapp cond.end# // Set TLV 0x2711 Util.putWord(buf, marker, 0x2711); marker += 2; // Length of TLV2711 differs betweeen normal message and file requst//#sijapp cond.if (target!="DEFAULT")&(modules_FILES="true")# if (this.fileTrans == null) { Util.putWord(buf, marker, 104 + textRaw.length, true); } else { Util.putWord(buf, marker, 119 + textRaw.length + filenameRaw.length + 1); }//#sijapp cond.else#//# Util.putWord(buf, marker, 104 + textRaw.length, true); //#sijapp cond.end# marker += 2; // Put 0x1b00 (unknown) Util.putWord(buf, marker, 0x1B00); marker += 2; // Put ICQ protocol version in LE Util.putWord(buf, marker, 0x0800); marker += 2; // Put capablilty (16 zero bytes) Util.putDWord(buf, marker, 0x00000000); marker += 4; Util.putDWord(buf, marker, 0x00000000); marker += 4; Util.putDWord(buf, marker, 0x00000000); marker += 4; Util.putDWord(buf, marker, 0x00000000); marker += 4; // Put some unknown stuff Util.putWord(buf, marker, 0x0000); marker += 2; Util.putByte(buf, marker, 0x03); marker += 1; // Set the DC_TYPE to "normal" if we send a file transfer request//#sijapp cond.if (target!="DEFAULT")&(modules_FILES="true")# if (this.fileTrans == null) Util.putDWord(buf, marker, 0x00000000); else Util.putDWord(buf, marker, 0x00000004);//#sijapp cond.else#//# Util.putDWord(buf, marker, 0x00000000);//#sijapp cond.end# marker += 4; // Put cookie, unkown 0x0e00 and cookie again Util.putWord(buf, marker, SEQ1, false); marker += 2; Util.putWord(buf, marker, 0x0e, false); marker += 2; Util.putWord(buf, marker, SEQ1, false); marker += 2; // Put 12 unknown zero bytes Util.putDWord(buf, marker, 0x00000000); marker += 4; Util.putDWord(buf, marker, 0x00000000); marker += 4; Util.putDWord(buf, marker, 0x00000000); marker += 4; // Put message type 0x0001 if normal message else 0x001a for file request//#sijapp cond.if (target!="DEFAULT")&(modules_FILES="true")# if (this.fileTrans == null) Util.putWord(buf, marker, this.plainMsg.getMessageType(), false); else Util.putWord(buf, marker, this.fileTrans.getMessageType(), false);//#sijapp cond.else#//# Util.putWord(buf, marker, this.plainMsg.getMessageType(),false); //#sijapp cond.end# marker += 2; // Put contact status Util.putWord(buf, marker, Util.translateStatusSend((int) Options .getLong(Options.OPTION_ONLINE_STATUS)), false); marker += 2; // Put priority Util.putWord(buf, marker, 0x01, false); marker += 2; // Put message//#sijapp cond.if (target!="DEFAULT")&(modules_FILES="true")# if (this.fileTrans == null) { // Put message length Util.putWord(buf, marker, textRaw.length + 1, false); marker += 2; // Put message System.arraycopy(textRaw, 0, buf, marker, textRaw.length); // TLV.MESSAGE marker += textRaw.length; Util.putByte(buf, marker, 0x00); marker++; // Put foreground, background color and guidlength Util.putDWord(buf, marker, 0x00000000); marker += 4; Util.putDWord(buf, marker, 0xFFFFFF00); marker += 4; Util.putDWord(buf, marker, 0x26000000); marker += 4; System.arraycopy(Icq.CAP_UTF8_GUID, 0, buf, marker, 38); // SUB_MSG_TYPE2.CAPABILITY marker += 38; } else { // Put message length Util.putWord(buf, marker, 1, false); marker += 2; // Put message (unused in file transfer request) Util.putByte(buf, marker, 0x00); marker++; // Put file transfer request command Util.putWord(buf, marker, 0x029, false); marker += 2; // Put 16 bytes of unknown binary stuff Util.putDWord(buf, marker, 0xf02d12d9); marker += 4; Util.putDWord(buf, marker, 0x3091d311); marker += 4; Util.putDWord(buf, marker, 0x8dd70010); marker += 4; Util.putDWord(buf, marker, 0x4b06462e); marker += 4; // Put 2 unknown zero bytes Util.putWord(buf, marker, 0x0000); marker += 2; // Put request type string length and string Util.putDWord(buf, marker, 0x0004, false); marker += 4; System.arraycopy(Util.stringToByteArray("File"), 0, buf, marker, 4); marker += 4; // Put 15 bytes of unknown binary stuff Util.putDWord(buf, marker, 0x00000100); marker += 4; Util.putDWord(buf, marker, 0x00010000); marker += 4; Util.putDWord(buf, marker, 0x00000000); marker += 4; Util.putWord(buf, marker, 0x0000); marker += 2; Util.putByte(buf, marker, 0x00); marker++; // Put remaining length Util.putDWord(buf, marker, 18 + textRaw.length + filenameRaw.length + 1, false); marker += 4; // Put description length and text Util.putDWord(buf, marker, textRaw.length, false); marker += 4; System.arraycopy(textRaw, 0, buf, marker, textRaw.length); marker += textRaw.length; // Put 4 unknown bytes Util.putDWord(buf, marker, 0x8c820222); marker += 4; // Put filename length and filename Util.putWord(buf, marker, filenameRaw.length + 1, false); marker += 2; System.arraycopy(filenameRaw, 0, buf, marker, filenameRaw.length); marker += filenameRaw.length; Util.putByte(buf, marker, 0x00); marker += 1; // Put total size of file transfer Util.putDWord(buf, marker, this.fileTrans.getSize(), false); marker += 4; // Put unknown 4 bytes Util.putDWord(buf, marker, 0x00008c82, false); marker += 4; }//#sijapp cond.else# // Put message length//# Util.putWord(buf, marker, textRaw.length + 1, false);//# marker += 2;//# // Put message//# System.arraycopy(textRaw, 0, buf, marker, textRaw.length); // TLV.MESSAGE//# marker += textRaw.length;//# Util.putByte(buf, marker, 0x00);//# marker++; // Put foreground, background color and guidlength//# Util.putDWord(buf, marker, 0x00000000);//# marker += 4;//# Util.putDWord(buf, marker, 0x00FFFFFF);//# marker += 4;//# Util.putDWord(buf, marker, 0x26000000);//# marker += 4;//# System.arraycopy(Icq.CAP_UTF8_GUID, 0, buf, marker, 38); // SUB_MSG_TYPE2.CAPABILITY//# marker += 38; //#sijapp cond.end# // Put TLV 0x03 Util.putWord(buf, marker, 0x0003, true); // CLI_SENDMSG.UNKNOWN marker += 2; Util.putWord(buf, marker, 0x0000); marker += 2; // Send packet SnacPacket snacPkt = new SnacPacket(SnacPacket.CLI_SENDMSG_FAMILY, SnacPacket.CLI_SENDMSG_COMMAND, 0, new byte[0], buf); Icq.sendPacket(snacPkt); // System.out.println("SendMessageAction: Sent the packet"); } SEQ1--; } // Forwards received packet, returns true if packet was consumed protected boolean forward(Packet packet) throws JimmException { return (false); } // Returns true if the action is completed public boolean isCompleted() { return (true); } // Returns true if an error has occured public boolean isError() { return (false); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -