[smuxi: 5/15] [Engine] Match emoji and and replace them with an image part



commit 3c87bbe8103cf7e9abe233dda10b2c0c5044e06f
Author: Carlos Martín Nieto <cmn dwim me>
Date:   Sat Jan 31 00:53:51 2015 +0100

    [Engine] Match emoji and and replace them with an image part
    
    Catch the :smile:-type of emoji and send an image part with a filename
    of smuxi-emoji://smile so the frontend can show the emoji pictures
    instead of the text.

 src/Engine/Config/MessageBuilderSettings.cs |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/Engine/Config/MessageBuilderSettings.cs b/src/Engine/Config/MessageBuilderSettings.cs
index c58bec5..169409e 100644
--- a/src/Engine/Config/MessageBuilderSettings.cs
+++ b/src/Engine/Config/MessageBuilderSettings.cs
@@ -333,6 +333,13 @@ namespace Smuxi.Engine
                 LinkFormat = "http://bugzilla.xamarin.com/show_bug.cgi?id={1}";
             });
 
+            // Emoji
+            regex = new Regex(@":(\w+):", RegexOptions.Compiled);
+            BuiltinPatterns.Add(new MessagePatternModel(regex) {
+                MessagePartType = typeof(ImageMessagePartModel),
+                LinkFormat = "smuxi-emoji://{1}",
+            });
+
             // TODO: msgid -> http://mid.gmane.org/{1}
             // TODO: ISSN/ISBN
             // TODO: Path: / or X:\


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]