IM 会話を開始するために使用される次のコードがあります。
public void IMbtn_Click(object sender, RoutedEventArgs e)
{
var participants = new List<string>();
participants.Add("blabla.com");
if (_lyncAutomation != null)
{
var bridgeNames = _info.Bridges.Where(b => b.Selected && b.Enabled).Select(b => b.Name);
var chatTitle = $"{_info.Title} {string.Join(", ", bridgeNames)}";
string chat = "Welcome to test's chat!";
AutomationModalities mode = AutomationModalities.InstantMessage;
var convoSettings = new Dictionary<AutomationModalitySettings, object>();
convoSettings.Add(AutomationModalitySettings.Subject, chatTitle);
convoSettings.Add(AutomationModalitySettings.FirstInstantMessage, chat);
convoSettings.Add(AutomationModalitySettings.SendFirstInstantMessageImmediately, true);
try
{
_lyncAutomation.BeginStartConversation(mode, participants, convoSettings,
StartConversationCallback, null);
}
catch (LyncClientException lyncClientException)
{
MessageBox.Show("Call failed.");
Logger.Log("Exception while creating Lync call: " + lyncClientException);
}
catch (SystemException systemException)
{
if (IsLyncException(systemException))
{
MessageBox.Show("Call failed.");
Logger.Log("Error: " + systemException);
}
else
{
throw;
}
}
}
}
このコードは、タイトルとすべてを含む完全な IM 会話を作成します。ただし、私の環境 (Skype for Business を使用) では、最初のメッセージは送信されませんが、Lync 2013 を使用する友人の環境では、最初のメッセージの送信に問題はありません。
誰かがこのようなことを聞いたことがありますか?
提供された支援について事前に感謝します。