UCMA – I’m Writing a Message

I was working on a UCMA (Unified Communications Managed API) issue the other day and wanted to integrate the “Is Writing a message” functionality that is oh so important in any chat conversation today.  My application is pretty simple, a chat bot is listening to incoming requests and directing them to their intended recipient.

You can see this in some of the built in examples, but if you haven’t looked there yet, this functionality is quite easy to implement.

In your MessageReceived event from your Message Flow, simply add the following line into the event before you send back your reply and this will trigger an event to fire when this occurs.

MessageFlow.LocalComposingState = ComposingState.Composing;

And that’s it, now you can know when the receiving user start to type a response, even when they take a pause only to have it fire again.