Commits

Patrick Cloke committed f753907

SkypeKit compiles.

  • Participants
  • Parent commits 7be9237

Comments (0)

Files changed (5)

File founder

-# HG changeset patch
-# Parent ac37e530f8cd4536e7887b079d8d59635a844049
-Bug 1739 - Founder should be considered higher than operator, r=fqueze.
-
-diff --git a/instantbird/content/conversation.xml b/instantbird/content/conversation.xml
---- a/instantbird/content/conversation.xml
-+++ b/instantbird/content/conversation.xml
-@@ -1039,14 +1039,14 @@
-          var buddy = aItem.chatBuddy;
-          var image;
-          if (!buddy.noFlags) {
--           if (buddy.op)
-+           if (buddy.founder)
-+             image = "founder";
-+           else if (buddy.op)
-              image = "operator";
-            else if (buddy.halfOp)
-              image = "half-operator";
-            else if (buddy.voiced)
-              image = "voice";
--           else if (buddy.founder)
--             image = "founder";
-          }
-          if (image)
-            aItem.setAttribute("image", "chrome://instantbird/skin/" + image + ".png");

File irc-split-messages

+# HG changeset patch
+# Parent 3e6bdc5f695c28131895e78179c65cad7d97ec77
+Bug 1712 - Send long IRC messages in several parts, r=fqueze.
+
+diff --git a/chat/protocols/irc/irc.js b/chat/protocols/irc/irc.js
+--- a/chat/protocols/irc/irc.js
++++ b/chat/protocols/irc/irc.js
+@@ -119,6 +119,42 @@ const GenericIRCConversation = {
+   sendMsg: function(aMessage) {
+     // Split the message by line breaks and send each one individually.
+     let messages = aMessage.split(/[\r\n]+/);
++
++    // A message is at least our prefix + a space + PRIVMSG + the target (nick
++    // or channel name) + a space and : + \r\n.
++    let maxLength = this._account.maxMessageLength -
++      this._account.countBytes(this._account.prefix) - 1 - 2 - 2 -
++      this._account.countBytes(this._account.buildMessage("PRIVMSG", this.name));
++
++    // Attempt to smartly split a string into multiple lines (based on the
++    // maximum number of characters the message can contain).
++    for (let i = 0; i < messages.length; ++i) {
++      let message = messages[i];
++      let length = this._account.countBytes(message);
++      if (length > maxLength) {
++        // Find the location of a space before the maximum length.
++        let index = message.lastIndexOf(" ", maxLength);
++        // Start the next message after the space.
++        let indexNext = index + 1;
++        // If no space was found.
++        if (index == -1) {
++            // Avoid the situation of adding empty strings into the array.
++            if (length < maxLength)
++                continue;
++            else {
++                // Take as much of the string as you can and start the next
++                // message on the next character.
++                index = maxLength;
++                indexNext = index;
++            }
++        }
++        // Remove the current message and insert the two new ones.
++        messages.splice(i, 1, message.substr(0, index),
++                        message.substr(indexNext));
++      }
++    }
++
++    // Send each message and display it in the conversation.
+     messages.forEach(function (aMessage) {
+       if (!aMessage.length)
+         return;
+@@ -670,6 +706,8 @@ ircAccount.prototype = {
+   _accountNickname: null,
+   // The nickname that will be used when connecting.
+   _requestedNickname: null,
++  // The full prefix (nick!user@host) as returned by the server.
++  prefix: null,
+ 
+   get normalizedName() this.normalize(this.name),
+ 
+diff --git a/chat/protocols/irc/ircBase.jsm b/chat/protocols/irc/ircBase.jsm
+--- a/chat/protocols/irc/ircBase.jsm
++++ b/chat/protocols/irc/ircBase.jsm
+@@ -336,6 +336,9 @@ var ircBase = {
+       // Check if our nick has changed.
+       if (aMessage.params[0] != this._nickname)
+         this.changeBuddyNick(this._nickname, aMessage.params[0]);
++      // Get our full prefix.
++      this.prefix = aMessage.params[1].slice(
++        aMessage.params[1].lastIndexOf(" ") + 1);
+       // If our status is Unavailable, tell the server.
+       if (this.imAccount.statusInfo.statusType < Ci.imIStatusInfo.STATUS_AVAILABLE)
+         this.observe(null, "status-changed");

File irc-whowas-simple

-# HG changeset patch
-# Parent da8b7c911fb9692c706f834f8cbaeed3962233a9
-Bug 1457 - Make use of all WHOWAS 312/314 response pairs, r=aleth.
-
-diff --git a/chat/protocols/irc/irc.js b/chat/protocols/irc/irc.js
---- a/chat/protocols/irc/irc.js
-+++ b/chat/protocols/irc/irc.js
-@@ -816,6 +816,11 @@ ircAccount.prototype = {
-     if (!hasOwnProperty(this.whoisInformation, nick))
-       this.whoisInformation[nick] = {"nick": aNick};
-   },
-+  // Copies the fields of aFields into the whois table. If the field already
-+  // exists, that field is ignored (it is assumed that the first server response
-+  // is the most up to date information, as is the case for 312/314). Note that
-+  // the whois info for a nick is reset whenever whois information is requested,
-+  // so the first response from each whois is recorded.
-   setWhois: function(aNick, aFields) {
-     let nick = this.normalize(aNick, this.userPrefixes);
-     // If the nickname isn't in the list yet, add it.
-@@ -825,9 +830,11 @@ ircAccount.prototype = {
-     // Set non-normalized nickname field.
-     this.whoisInformation[nick]["nick"] = aNick;
- 
--    // Set the WHOIS fields.
--    for (let field in aFields)
--      this.whoisInformation[nick][field] = aFields[field];
-+    // Set the WHOIS fields, but only the first time a field is set.
-+    for (let field in aFields) {
-+      if (!this.whoisInformation[nick].hasOwnProperty(field))
-+        this.whoisInformation[nick][field] = aFields[field];
-+    }
- 
-     return true;
-   },
+irc-split-messages
 mozconfig
 hgignore
 kill-xpconnect-assert
 irc-docs
 irc-docs-services
-irc-whowas-simple
 otr
 monitor
 irc-isupport
 irc-cap
-founder
 irc-minor
 oscar
 sipe-mozconfig
 remove-purpleStorage
 sipe-aux
 sipe-po
-skipekit
+skypekit
 smileys
 normalizedName-fix
 irc-ident
 # HG changeset patch
-# Parent c5215bfe2644416a643ac1b053395cbbda99e911
+# Parent 5150c49e3a6cf9516b07a21c49888698c0b824c7
 
 diff --git a/.hgignore b/.hgignore
 --- a/.hgignore
 +++ b/.hgignore
-@@ -15,3 +15,4 @@ attachment.cgi\?id=*
- mozconfig-*
+@@ -16,4 +16,5 @@ mozconfig-*
  .mozconfig*
  objdir-*
+ chat/protocols/skype/skypekit/*
 +chat/protocols/skype/skypekit/*
+ *.komodoproject
+\ No newline at end of file
 diff --git a/chat/Makefile.in b/chat/Makefile.in
 --- a/chat/Makefile.in
 +++ b/chat/Makefile.in
-@@ -14,6 +14,7 @@ PROTOCOLS = \
- 		gtalk \
+@@ -15,6 +15,7 @@ PROTOCOLS = \
  		irc \
+ 		oscar \
  		twitter \
 +		skype \
  		xmpp \
 new file mode 100644
 --- /dev/null
 +++ b/chat/protocols/skype/Makefile.in
-@@ -0,0 +1,189 @@
+@@ -0,0 +1,215 @@
 +# This Source Code Form is subject to the terms of the Mozilla Public
 +# License, v. 2.0. If a copy of the MPL was not distributed with this
 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
 +		-I$(srcdir)/skypekit/interfaces/skype/cpp_embedded/src/platform/threading \
 +		-I$(srcdir)/skypekit/interfaces/skype/cpp_embedded/src/types \
 +		-I$(srcdir)/skypekit/ipc/cpp \
++		-I$(srcdir)/skypekit/ipc/cpp/AVTransport \
 +		-I$(srcdir)/skypekit/ipc/cpp/platform/se \
 +		-I$(srcdir)/skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/include \
 +		-I$(srcdir)/skypekit/ipc/cpp/ssl/cyassl/include \
++		-I$(srcdir)/skypekit/ipc/cpp/ssl/cyassl/include/openssl \
 +		-I$(srcdir)/skypekit/ipc/cpp/VideoBuffers \
 +		$(NULL)
 +
 +endif
 +
 +# The SID IPC library.
-+CPPSRC = \
++CPPSRCS = \
 +		skypekit/ipc/cpp/SidApi.cpp \
 +		skypekit/ipc/cpp/SidAVDummyHelpers.cpp \
-+		skypekit/ipc/cpp/SidAVIpcTransport.cpp \
 +		skypekit/ipc/cpp/SidAVServer.cpp \
 +		skypekit/ipc/cpp/SidAVTransportWrapper.cpp \
 +		skypekit/ipc/cpp/SidClientConnection.cpp \
-+		skypekit/ipc/cpp/SidClientConnectionSym.cpp \
 +		skypekit/ipc/cpp/SidClientSession.cpp \
 +		skypekit/ipc/cpp/SidCommandProcessor.cpp \
 +		skypekit/ipc/cpp/SidConcurrentCircularBuffer.cpp \
 +		skypekit/ipc/cpp/SidConnection.cpp \
-+		skypekit/ipc/cpp/SidConnectionTransport.cpp \
 +		skypekit/ipc/cpp/SidDebugging.cpp \
-+		skypekit/ipc/cpp/SidField.cpp \
 +		skypekit/ipc/cpp/SidListener.cpp \
-+		skypekit/ipc/cpp/SidMsgQueueConnection.cpp \
 +		skypekit/ipc/cpp/SidProtocolBinClient.cpp \
 +		skypekit/ipc/cpp/SidProtocolBinCommon.cpp \
 +		skypekit/ipc/cpp/SidProtocolBinServer.cpp \
 +		skypekit/ipc/cpp/SidProtocolFactory.cpp \
 +		skypekit/ipc/cpp/SidServerConnection.cpp \
-+		skypekit/ipc/cpp/SidServerConnectionSym.cpp \
 +		skypekit/ipc/cpp/SidServerSession.cpp \
 +		skypekit/ipc/cpp/SidSession.cpp \
 +		skypekit/ipc/cpp/SidTLSEncryption.cpp \
 +		skypekit/ipc/cpp/SidTransportLog.cpp \
-+		skypekit/ipc/cpp/AVTransport/NamedPipes.cpp \
-+		skypekit/ipc/cpp/AVTransport/ShmTransport.cpp \
 +		skypekit/ipc/cpp/AVTransport/SocketTransport.cpp \
 +		skypekit/ipc/cpp/platform/se/SidPlatform.cpp \
-+		skypekit/ipc/cpp/platform/se/SidProtocolBinCommonPlatform.cpp \
++		$(NULL)
++
++CSRCS = \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/_arc4.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/_md4.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/_md5.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/_misc.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/_sha256.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/aes.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/asm.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/coding.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/des3.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/dh.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/dsa.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/hc128.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/hmac.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/integer.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/misc.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/pwdbased.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/rabbit.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/random.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/ripemd.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/rsa.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/sha.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/sha512.c \
++		skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src/tfm.c \
++		skypekit/ipc/cpp/ssl/cyassl/src/cyassl_int.c \
++		skypekit/ipc/cpp/ssl/cyassl/src/cyassl_io.c \
++		skypekit/ipc/cpp/ssl/cyassl/src/keys.c \
++		skypekit/ipc/cpp/ssl/cyassl/src/sniffer.c \
++		skypekit/ipc/cpp/ssl/cyassl/src/ssl.c \
++		skypekit/ipc/cpp/ssl/cyassl/src/tls.c \
 +		$(NULL)
 +
 +# Compile all the Skype interface code.
-+#CPPSRCS += skypekit/interfaces/skype/cpp_embedded/src/api/skype-embedded_2.cpp
 +CPPSRCS += \
 +		skypekit/interfaces/skype/cpp_embedded/src/api/sidg_msgs_Skype.cpp \
 +		skypekit/interfaces/skype/cpp_embedded/src/api/sidg_Skypeaction_call.cpp \
 +		skypekit/interfaces/skype/cpp_embedded/src/types/skype-uint64-list.cpp \
 +		$(NULL)
 +
-+# The actual implementation.
-+CPPSRCS += \
-+		skypeProtocol.cpp \
-+		skypeModule.cpp \
-+		$(NULL)
-+
 +#ifdef USE_OPENGL
 +#		DEFINES += -DSKYPEKIT_SURFACE_RENDERING
 +#    ifeq ($(OS_ARCH),WINNT)
 +#    else
 +#				CPPSRCS += \
 +#						skypekit/ipc/cpp/AVTransport/ShmIpcSysV.cpp \
++#           skypekit/ipc/cpp/AVTransport/ShmTransport.cpp \
 +#						skypekit/ipc/cpp/VideoBuffers/PosixShm.cpp \
 +#						skypekit/ipc/cpp/VideoBuffers/SysVShm.cpp \
 +#						$(NULL)
 +#    endif
 +#endif
 +
-+#ifeq ($(OS_ARCH),WINNT)
-+#		CPPSRCS += \
-+#				skypekit/interfaces/skype/cpp_embedded/src/platform/threading/win/skype-thread-win.cpp \
-+#				skypekit/ipc/cpp/SidClientConnectionWin.cpp \
-+#				skypekit/ipc/cpp/SidServerConnectionWin.cpp \
-+#				$(NULL)
-+#else
-+#		CPPSRCS += \
-+#				skypekit/interfaces/skype/cpp_embedded/src/platform/threading/pthread/skype-thread-pthread.cpp \
-+#				skypekit/ipc/cpp/ShmIpcPosix.cpp \
-+#				skypekit/ipc/cpp/SidClientConnectionUnx.cpp \
-+#				skypekit/ipc/cpp/SidServerConnectionUnx.cpp \
-+#				$(NULL)
-+#endif
++ifeq ($(OS_ARCH),WINNT)
++		CPPSRCS += \
++				skypekit/interfaces/skype/cpp_embedded/src/platform/threading/win/skype-thread-win.cpp \
++				skypekit/ipc/cpp/AVTransport/NamedPipes.cpp \
++				$(NULL)
++
++		DEFINES += -D_WIN32_WCE
++else
++		CPPSRCS += \
++				skypekit/interfaces/skype/cpp_embedded/src/platform/threading/pthread/skype-thread-pthread.cpp \
++				skypekit/ipc/cpp/ShmIpcPosix.cpp \
++				skypekit/ipc/cpp/AVTransport/UnixSocket.cpp \
++				$(NULL)
++endif
++
++# The actual implementation.
++CPPSRCS += \
++		skypeProtocol.cpp \
++		skypeModule.cpp \
++		$(NULL)
 +
 +#EXTRA_COMPONENTS = skype.manifest
 +
 +			skypekit/interfaces/skype/cpp_embedded/src/platform/threading/pthread \
 +			skypekit/interfaces/skype/cpp_embedded/src/ssl \
 +			skypekit/interfaces/skype/cpp_embedded/src/types \
++			skypekit/ipc/cpp/AVTransport \
 +			skypekit/ipc/cpp/platform/se \
 +			skypekit/ipc/cpp/ssl/cyassl/ctaocrypt/src \
 +			skypekit/ipc/cpp/ssl/cyassl/include/openssl \