diff options
Diffstat (limited to 'src/net/java/sip')
4 files changed, 60 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java index 753830e..db46f91 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java @@ -498,7 +498,16 @@ public class OperationSetBasicInstantMessagingJabberImpl OperationSetPersistentPresence.class); if(smackMessageListener == null) + { smackMessageListener = new SmackMessageListener(); + } + else + { + // make sure this listener is not already installed in this + // connection + jabberProvider.getConnection() + .removePacketListener(smackMessageListener); + } jabberProvider.getConnection().addPacketListener( smackMessageListener, @@ -633,6 +642,12 @@ public class OperationSetBasicInstantMessagingJabberImpl // removes body end tag .replaceAll("\\</[bB][oO][dD][yY].*?>",""); + // for some reason ' is not rendered correctly + // from our ui, lets use its equivalent. Other + // similar chars(< > & ") seem ok. + receivedMessage = + receivedMessage.replaceAll("'", "'"); + newMessage = createMessage(receivedMessage, HTML_MIME_TYPE); } diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetMessageWaitingSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetMessageWaitingSipImpl.java index 2e15fc1..e0b0793 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetMessageWaitingSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetMessageWaitingSipImpl.java @@ -81,6 +81,22 @@ public class OperationSetMessageWaitingSipImpl messageWaitingNotificationListeners = new HashMap<MessageType, List<MessageWaitingListener>>(); + /** + * Number of unread messages, count so we don't duplicate events. + */ + private int unreadMessages = 0; + /** + * Number of old messages, count so we don't duplicate events. + */ + private int readMessages = 0; + /** + * Number of unread urgent messages, count so we don't duplicate events. + */ + private int unreadUrgentMessages = 0; + /** + * Number of old urgent messages, count so we don't duplicate events. + */ + private int readUrgentMessages = 0; /** * Creates this operation set. @@ -238,6 +254,25 @@ public class OperationSetMessageWaitingSipImpl int unreadUrgentMessages, int readUrgentMessages) { + synchronized(this) + { + if(this.unreadMessages == unreadMessages + && this.readMessages == readMessages + && this.unreadUrgentMessages == unreadUrgentMessages + && this.readUrgentMessages == readUrgentMessages) + { + // no new information skip event; + return; + } + else + { + this.unreadMessages = unreadMessages; + this.readMessages = readMessages; + this.unreadUrgentMessages = unreadUrgentMessages; + this.readUrgentMessages = readUrgentMessages; + } + } + MessageType msgType = MessageType.valueOfByType(msgTypeStr); MessageWaitingEvent event = new MessageWaitingEvent( diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java index efe4cd0..e874893 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java @@ -2022,6 +2022,9 @@ public class ProtocolProviderServiceSipImpl } } + if(proxySocketAddress == null) + throw new UnknownHostException(); + proxyAddress = proxySocketAddress.getAddress(); proxyPort = proxySocketAddress.getPort(); diff --git a/src/net/java/sip/communicator/impl/protocol/sip/SipStackSharing.java b/src/net/java/sip/communicator/impl/protocol/sip/SipStackSharing.java index fba597c..9f85d4f 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/SipStackSharing.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/SipStackSharing.java @@ -1075,7 +1075,14 @@ public class SipStackSharing return; } } + } + catch(Throwable ex) + { + logger.warn("Cannot apply incoming request modification!", ex); + } + try + { // using asterisk voice mail initial notify for messages // is ok, but on the fly received messages their notify comes // without subscription-state, so we add it in order to be able to |