Gets the messages from a topic.
The circle ID, Topic you want to pull from, and any applicable filters on the messages you want.
Whether it was successful or failed, and the desired messages.
public async Task<GetMessgesReply> GetMessges(GetMessgesRequest request)
public class GetMessagesRequest {
public string CircleId;
public string TopicId;
public List<Int32> MsgTypeFilters;
}
public class GetMessagesReply
{
public ReturnStatus Status;
public List<MessageInfo> Messages;
}
public void GetMessages(string circleId, string topidId)
{
GetMessgesRequest request = new GetMessgesRequest()
{CircleId = circleId, TopicId = topidId, MsgTypeFilters = { 100 }}; // 100 = MarkupText
GetMessgesReply reply = _circle.GetMessges(request);
Console.WriteLine(reply.Status.Message);
foreach (var msg in reply.Messages)
{
DateTime msgTime = new DateTime(1970, 1, 1).AddMilliseconds(msg.MessageTimeOffset);
Console.WriteLine($"{msg.Message}");
}
}