~ubuntu-branches/ubuntu/trusty/smuxi/trusty-proposed

« back to all changes in this revision

Viewing changes to src/Engine/Messages/MessageModel.cs

  • Committer: Package Import Robot
  • Author(s): Mirco Bauer
  • Date: 2013-05-25 22:11:31 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130525221131-nd2mc0kzubuwyx20
Tags: 0.8.11-1
* [22d13d5] Imported Upstream version 0.8.11
* [6d2b95a] Refreshed patches
* [89eb66e] Added ServiceStack libraries to smuxi-engine package
* [848ab10] Enable Campfire engine
* [c6dbdc7] Always build db4o for predictable build result
* [13ec489] Exclude OS X specific libraries from dh_clideps

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
using System;
24
24
using System.Text;
 
25
using System.Text.RegularExpressions;
25
26
using System.Collections;
26
27
using System.Collections.Generic;
27
28
using System.Runtime.Serialization;
249
250
            f_MessageParts = parts;
250
251
        }
251
252
 
 
253
        public string GetNick()
 
254
        {
 
255
            // HACK: MessageModel doesn't contain a Sender/Origin property
 
256
            // yet, thus we have to retrieve the information from the
 
257
            // meesage itself
 
258
            // TODO: extend MessageModel with Origin property
 
259
            var msgText = ToString();
 
260
            var match = Regex.Match(msgText, "^<([^ ]+)>");
 
261
            if (match.Success && match.Groups.Count >= 2) {
 
262
                return match.Groups[1].Value;
 
263
            }
 
264
 
 
265
            return null;
 
266
        }
 
267
 
252
268
        public static bool operator ==(MessageModel a, MessageModel b)
253
269
        {
254
270
            if (System.Object.ReferenceEquals(a, b)) {