            this._prplConv[aTargetId].typingState == Ci.prplIConvIM.TYPING)))
        this.target = this._prplConv[aTargetId];
 +
-+    if (aTopic == "new-text") {
-+      this.notifyObservers(aSubject, "received-message");
-+      if (aSubject.cancelled)
-+        return;
-+    }
-+
      this.notifyObservers(aSubject, aTopic, aData);
-     if (aTopic == "new-text") {
-       Services.obs.notifyObservers(aSubject, aTopic, aData);
-       if (aSubject.incoming && !aSubject.system &&
-           (!this.isChat || aSubject.containsNick)) {
-         this.notifyObservers(aSubject, "new-directed-incoming-message", aData);
-         Services.obs.notifyObservers(aSubject, "new-directed-incoming-message", aData);
-       }
-@@ -294,17 +310,47 @@ UIConversation.prototype = {
+-    if (aTopic == "new-text") {
+-      Services.obs.notifyObservers(aSubject, aTopic, aData);
+-      if (aSubject.incoming && !aSubject.system &&
+-          (!this.isChat || aSubject.containsNick)) {
+-        this.notifyObservers(aSubject, "new-directed-incoming-message", aData);
+-        Services.obs.notifyObservers(aSubject, "new-directed-incoming-message", aData);
+-      }
+-    }
+   },
+ 
+   systemMessage: function(aText, aIsError) {
+     let flags = {system: true, noLog: true, error: !!aIsError};
+     (new Message("system", aText, flags)).conversation = this;
+   },
  
    // prplIConversation
    get isChat() this.target.isChat,

# User Arlo Breault <arlolra@gmail.com>
# Date 1409207291 25200
#      Wed Aug 27 23:28:11 2014 -0700
# Node ID 35b6b091c351165d4a7a21e468d5afe6842efb14
# Parent  f54bd01f595b76e980d6661b7316fd8738b10119
An API to support OTR-like protocols in Instantbird


diff --git a/chat/components/src/imConversations.js b/chat/components/src/imConversations.js
--- a/chat/components/src/imConversations.js
+++ b/chat/components/src/imConversations.js
@@ -10,16 +10,65 @@ Cu.import("resource:///modules/jsProtoHe
 
 var gLastUIConvId = 0;
 var gLastPrplConvId = 0;
