[sip-comm-cvs] CVS update: /sip-communicator/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java

emcho at dev.java.net emcho at dev.java.net
Tue Apr 24 15:42:59 CEST 2007


User: emcho   
Date: 2007-04-24 13:42:59+0000
Log:
 splitting messages bugs. removing

File Changes:

Directory: /sip-communicator/src/net/java/sip/communicator/impl/protocol/icq/
=============================================================================

File [changed]: OperationSetBasicInstantMessagingIcqImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/protocol/icq/OperationSetBasicInstantMessagingIcqImpl.java?r1=1.23&r2=1.24
Delta lines:  +17 -49
---------------------
--- OperationSetBasicInstantMessagingIcqImpl.java	2007-04-23 18:11:52+0000	1.23
+++ OperationSetBasicInstantMessagingIcqImpl.java	2007-04-24 13:42:57+0000	1.24
@@ -210,62 +210,30 @@
                "The specified contact is not a Icq contact."
                + to);
 
-
         ImConversation imConversation =
                 icqProvider.getAimConnection().getIcbmService().
                 getImConversation(
                     new Screenname(to.getAddress()));
 
-        //split the message in multiple parts in case it is bigger than the
-        //max message length
-        LinkedList messageParts = new LinkedList();
-        String messageContent = message.getContent();
-
-        while (messageContent.length() > MAX_MSG_LEN)
-        {
-            messageParts.add(messageContent.substring(0, MAX_MSG_LEN));
-            messageContent = messageContent.substring(MAX_MSG_LEN);
-        }
-
-        if (messageContent.length() > 0)
-            messageParts.add(messageContent);
-
-        //now send the all the parts
-        for(int i = 0; i < messageParts.size(); i++)
-        {
-            String messageSegment = (String)messageParts.get(i);
             if (to.getPresenceStatus().isOnline())
             {
                 //do not add the conversation listener in here. we'll add it
                 //inside the icbm listener
-                imConversation.sendMessage(new SimpleMessage(messageSegment));
+            imConversation.sendMessage(new SimpleMessage(message.getContent()));
             }
             else
-            {
-                imConversation.sendMessage(new SimpleMessage(messageSegment)
+            imConversation.sendMessage(new SimpleMessage(message.getContent())
                                            , true);
-            }
 
             //temporarily and uglity fire the sent event here.
-            /** @todo move elsewhere */
-            //in case we have a multi part message, make sure that at least
-            //the first message delivered event is for a message with the same
-            //uid as the one that was passed to us.
+        /** @todo move elsewhaere */
             MessageDeliveredEvent msgDeliveredEvt
                 = new MessageDeliveredEvent(
-                    new MessageIcqImpl(messageSegment
-                                       , message.getContentType()
-                                       , message.getEncoding()
-                                       , message.getSubject()
-                                       , (i == 0)
-                                           ? message.getMessageUID()
-                                           : null)
-                        , to
-                        , new Date());
+                message, to, new Date());
 
             fireMessageEvent(msgDeliveredEvt);
         }
-    }
+
 
     /**
      * Retreives all offline Messages If any.




---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: cvs-help at sip-communicator.dev.java.net





More information about the commits mailing list