private void BuildImage(int recNum, string msg, int imgPos, int[] recs, SortedDictionary <short, string> msgFormat, bool conference, byte[] bin, string path) { stMsg outMsg = BuildMsgInfo((uint)recs[recNum], msg); stMsgImage outMsgImage = BuildImageQuery(bin, outMsg.Recipient, path); int listLength; List <stMsgRichFormat> outMsgRichFormat = BuildRichImg(out listLength, imgPos); stMsgRich outMsgRich = BuildRichInfo(listLength); if (!conference) { ForwardImageRequest(outMsg, outMsgRich, outMsgRichFormat, listLength, outMsgImage); } }
private stMsgImage BuildImageQuery(byte[] binary, uint uin, string path) { stMsgImage outMsgImage = new stMsgImage(); outMsgImage.Unknown = 0x109; outMsgImage.Size = binary.Length; outMsgImage.CRC32 = new CRC32().GetCrc32(new MemoryStream(binary)); imageBuff.pushSave(uin, new imageBuffEl() { bin = binary, path = path }); return(outMsgImage); }
private void ForwardImageRequest(stMsg outMsg, stMsgRich outMsgRich, List <stMsgRichFormat> outRichList, int listLength, stMsgImage image) { outMsg.Header.Size = 13 + (uint)outMsg.Message.Length; if (outRichList.Count > 0) { outMsg.Header.Size += (uint)listLength + 3; } ForwardData(RawSerialize(outMsg), 21 + outMsg.Message.Length); if (outRichList.Count > 0) { ForwardData(RawSerialize(outMsgRich), 3); outRichList.ForEach(delegate(stMsgRichFormat formatItem) { ForwardData(RawSerialize(formatItem), 3); ForwardData(RawSerialize(image), 10); }); } return; }