public MessageMetadata parseNextPacket() { try { if (firstPacket) { firstPacket = false; HistoryStartPacket hsp = new HistoryStartPacket(innerDataStream); } MessageMetadata mmd = new MessageMetadata(innerDataStream); MessageContent mc = new MessageContent(innerDataStream); // that's kind of redundant, but we still need to parse it, otherwise // the next call to parseNextPacket will fail mmd.selectTextFromContentPacket(mc); return mmd; } catch (EndOfStreamException) { return null; } }
internal void selectTextFromContentPacket(MessageContent mc) { if (string.IsNullOrEmpty(Text)) Text = mc.Text; }