SkypeMentionNormalizeMiddleware Class

  • java.lang.Object
    • com.microsoft.bot.builder.SkypeMentionNormalizeMiddleware

Implements

public class SkypeMentionNormalizeMiddleware
implements Middleware

Middleware to patch mention Entities from Skype since they don't conform to expected values. Bots that interact with Skype should use this middleware if mentions are used.

A Skype mention "text" field is of the format: <at id=\"28:2bc5b54d-5d48-4ff1-bd25-03dcbb5ce918\">botname</at> But Activity.Text doesn't contain those tags and RemoveMentionText can't remove the entity from Activity.Text. This will remove the <at> nodes, leaving just the name.

Constructor Summary

Constructor Description
SkypeMentionNormalizeMiddleware()

Method Summary

Modifier and Type Method and Description
static void normalizeSkypeMentionText(Activity activity)

Fixes incorrect Skype mention text.

java.util.concurrent.CompletableFuture<java.lang.Void> onTurn(TurnContext context, NextDelegate next)

Middleware implementation which corrects Entity.Mention.Text to a value RemoveMentionText can work with.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

SkypeMentionNormalizeMiddleware

public SkypeMentionNormalizeMiddleware()

Method Details

normalizeSkypeMentionText

public static void normalizeSkypeMentionText(Activity activity)

Fixes incorrect Skype mention text. This will change the text value for all Skype mention entities.

Parameters:

activity - The Activity to correct.

onTurn

public CompletableFuture onTurn(TurnContext context, NextDelegate next)

Middleware implementation which corrects Entity.Mention.Text to a value RemoveMentionText can work with.

Parameters:

context - The context object for this turn.
next - The delegate to call to continue the bot middleware pipeline.

Applies to