|
|
|
@ -7,6 +7,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
import net.java.sip.communicator.service.protocol.*;
|
|
|
|
import net.java.sip.communicator.service.protocol.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Implementation of Basic Instant Messaging as utilized for IRC private
|
|
|
|
|
|
|
|
* user-to-user messaging.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @author Danny van Heumen
|
|
|
|
|
|
|
|
*/
|
|
|
|
public class OperationSetBasicInstantMessagingIrcImpl
|
|
|
|
public class OperationSetBasicInstantMessagingIrcImpl
|
|
|
|
extends AbstractOperationSetBasicInstantMessaging
|
|
|
|
extends AbstractOperationSetBasicInstantMessaging
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -21,10 +27,12 @@ public class OperationSetBasicInstantMessagingIrcImpl
|
|
|
|
* @param provider IRC provider service.
|
|
|
|
* @param provider IRC provider service.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public OperationSetBasicInstantMessagingIrcImpl(
|
|
|
|
public OperationSetBasicInstantMessagingIrcImpl(
|
|
|
|
ProtocolProviderServiceIrcImpl provider)
|
|
|
|
final ProtocolProviderServiceIrcImpl provider)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (provider == null)
|
|
|
|
if (provider == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
throw new IllegalArgumentException("provider cannot be null");
|
|
|
|
throw new IllegalArgumentException("provider cannot be null");
|
|
|
|
|
|
|
|
}
|
|
|
|
this.provider = provider;
|
|
|
|
this.provider = provider;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -39,8 +47,9 @@ public OperationSetBasicInstantMessagingIrcImpl(
|
|
|
|
* @param subject Message subject
|
|
|
|
* @param subject Message subject
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public MessageIrcImpl createMessage(String content, String contentType,
|
|
|
|
public MessageIrcImpl createMessage(final String content,
|
|
|
|
String contentEncoding, String subject)
|
|
|
|
final String contentType, final String contentEncoding,
|
|
|
|
|
|
|
|
final String subject)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new MessageIrcImpl(content, contentType, contentEncoding,
|
|
|
|
return new MessageIrcImpl(content, contentType, contentEncoding,
|
|
|
|
subject);
|
|
|
|
subject);
|
|
|
|
@ -96,7 +105,7 @@ public boolean isOfflineMessagingSupported()
|
|
|
|
* @return returns true if content type is supported
|
|
|
|
* @return returns true if content type is supported
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean isContentTypeSupported(String contentType)
|
|
|
|
public boolean isContentTypeSupported(final String contentType)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return OperationSetBasicInstantMessaging.HTML_MIME_TYPE
|
|
|
|
return OperationSetBasicInstantMessaging.HTML_MIME_TYPE
|
|
|
|
.equalsIgnoreCase(contentType);
|
|
|
|
.equalsIgnoreCase(contentType);
|
|
|
|
@ -106,10 +115,10 @@ public boolean isContentTypeSupported(String contentType)
|
|
|
|
* {@inheritDoc}
|
|
|
|
* {@inheritDoc}
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param message the received message
|
|
|
|
* @param message the received message
|
|
|
|
* @param contactId the sender
|
|
|
|
* @param from the sender
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void fireMessageReceived(Message message, Contact from)
|
|
|
|
protected void fireMessageReceived(final Message message, final Contact from)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
super.fireMessageReceived(message, from);
|
|
|
|
super.fireMessageReceived(message, from);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -121,7 +130,7 @@ protected void fireMessageReceived(Message message, Contact from)
|
|
|
|
* @param to Contact to deliver message to.
|
|
|
|
* @param to Contact to deliver message to.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void fireMessageDelivered(Message message, Contact to)
|
|
|
|
protected void fireMessageDelivered(final Message message, final Contact to)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
super.fireMessageDelivered(message, to);
|
|
|
|
super.fireMessageDelivered(message, to);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -134,8 +143,8 @@ protected void fireMessageDelivered(Message message, Contact to)
|
|
|
|
* @param errorCode Error code of failed delivery.
|
|
|
|
* @param errorCode Error code of failed delivery.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void fireMessageDeliveryFailed(Message message, Contact to,
|
|
|
|
protected void fireMessageDeliveryFailed(final Message message,
|
|
|
|
int errorCode)
|
|
|
|
final Contact to, final int errorCode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
super.fireMessageDeliveryFailed(message, to, errorCode);
|
|
|
|
super.fireMessageDeliveryFailed(message, to, errorCode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|