Pedro Pertino
Pedro Pertino

Reputation: 95

Lync SDK get sent or received text

Before anything I already saw this post: Lync ConversationRemoved get current conversation text

I implemented that solution, but I really need to get the already sent or received text. The thing is, although I have my application registered as automatically open, if I get messaged with my window closed, I loose the first text (that's just an example). Anybody know how can I get the text?

I can't find it anywhere. Not in Conversation class or ConversationManager.

English is not my native language, hope you can understand me anyways.

Upvotes: 0

Views: 1459

Answers (2)

w5l
w5l

Reputation: 5746

You're missing the first text, I'm assuming you mean that the first line is missing? The text that starts the IM conversation can be found in the so-called "Toast".

The toast is the popup you get on your Lync client when a new conversation is started. In case of IM conversations, the first message is part of the toast and shown to the user in this popup. It is not send over the instant messaging flow.

MSDN documentation: ToastMessage class

The ToastMessage is a property of InviteReceivedEventArgs [MSDN]. Your incoming call handler will probably handle CallReceivedEventArgs, which inherits InviteReceivedEventArgs.

private void OnIncomingInstantMessagingCallReceived(
    object sender,
    CallReceivedEventArgs<InstantMessagingCall> e)
{
    var toast = e.ToastMessage; // There she is. Mind you it can be null too.
}

Upvotes: 1

Tom Morgan
Tom Morgan

Reputation: 2365

If I understand the question correctly, you want to get the conversation that happened before your application connected? Like, getting a history? I don't think this is possible in the API - you can't use the API to look at historical data, only what is happening "now". You might have some success looking in the Lync database (though I don't know where!)

Upvotes: 0

Related Questions