net.kano.joscar.snaccmd.icbm
Class SendImIcbm

java.lang.Object
  extended bySnacCommand
      extended byAbstractIcbm
          extended byAbstractImIcbm
              extended bySendImIcbm

public class SendImIcbm
extends AbstractImIcbm

A SNAC command used to send an instant message to another user.

See Also:
RecvImIcbm
Source of this SNAC:
AIM client
SNAC command type:
Family 0x04, command 0x06

Field Summary
 
Fields inherited from class AbstractIcbm
CHANNEL_CHAT, CHANNEL_IM, CHANNEL_RV
 
Fields inherited from class SnacCommand
SNACFLAG_DEFAULT
 
Constructor Summary
protected SendImIcbm(SnacPacket packet)
          Generates an IM send command from the given incoming SNAC packet.
  SendImIcbm(java.lang.String sn, InstantMessage message, boolean autoResponse, long messageId, boolean wantsIcon, OldIconHashInfo iconInfo, ExtraInfoBlock[] expInfoBlocks, boolean ackRequested)
          Creates a new outgoing IM with the given properties.
  SendImIcbm(java.lang.String sn, java.lang.String message)
          Creates a new outgoing IM with the given message text to the given screenname.
  SendImIcbm(java.lang.String sn, java.lang.String message, boolean autoresponse)
          Creates a new unencrypted outgoing IM with the given message text to the given screenname.
  SendImIcbm(java.lang.String sn, java.lang.String message, boolean autoResponse, long messageId, boolean wantsIcon, OldIconHashInfo iconInfo, ExtraInfoBlock[] expInfoBlocks, boolean ackRequested)
          Creates a new unencrypted outgoing IM with the given properties.
 
Method Summary
 java.lang.String getScreenname()
          Returns the screenname to whom this message is to be sent.
 boolean isAckRequested()
          Returns whether or not a MessageAck was requested.
protected  void writeChannelData(java.io.OutputStream out)
          Writes the channel-specific data for this ICBM command to the given output stream.
 
Methods inherited from class AbstractImIcbm
getAimExpressionInfo, getIconInfo, getMessage, isAutoResponse, senderWantsIcon
 
Methods inherited from class AbstractIcbm
getChannel, getChannelData, getIcbmChannel, getIcbmMessageId, toString, writeData
 
Methods inherited from class SnacCommand
getCommand, getFamily, getFlag1, getFlag2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SendImIcbm

protected SendImIcbm(SnacPacket packet)
Generates an IM send command from the given incoming SNAC packet.

Parameters:
packet - an incoming IM send packet

SendImIcbm

public SendImIcbm(java.lang.String sn,
                  java.lang.String message)
Creates a new outgoing IM with the given message text to the given screenname. No icon is requested, no icon hash data are provided, the message is not marked as an auto-response, and an acknowledgement packet is requested. Also, the ICBM message ID is set to 0.

Parameters:
sn - the screenname to whom to send the given message
message - the message to send

SendImIcbm

public SendImIcbm(java.lang.String sn,
                  java.lang.String message,
                  boolean autoresponse)
Creates a new unencrypted outgoing IM with the given message text to the given screenname. No icon is requested, no icon hash data are provided, and an acknowledgement packet is requested. Also, the ICBM message ID is set to 0.

Parameters:
sn - the screenname to whom to send the given message
message - the message to send
autoresponse - whether this message is an "auto-response" or not

SendImIcbm

public SendImIcbm(java.lang.String sn,
                  java.lang.String message,
                  boolean autoResponse,
                  long messageId,
                  boolean wantsIcon,
                  OldIconHashInfo iconInfo,
                  ExtraInfoBlock[] expInfoBlocks,
                  boolean ackRequested)
Creates a new unencrypted outgoing IM with the given properties. Test

Parameters:
sn - the screenname to whom to send the given message
message - the message to send
autoResponse - whether this message is an "auto-response" or not
messageId - an ICBM message ID to attach to this message
wantsIcon - whether or not to request the receiver's buddy icon
iconInfo - a block of buddy icon hash information to "advertise" to the receiver
expInfoBlocks - a list of AIM Expression information blocks
ackRequested - whether a MessageAck should be sent in response to this command

SendImIcbm

public SendImIcbm(java.lang.String sn,
                  InstantMessage message,
                  boolean autoResponse,
                  long messageId,
                  boolean wantsIcon,
                  OldIconHashInfo iconInfo,
                  ExtraInfoBlock[] expInfoBlocks,
                  boolean ackRequested)
Creates a new outgoing IM with the given properties.

Parameters:
sn - the screenname to hom to send the given message
message - the message to send
autoResponse - whether this message is an "auto-response" or not
messageId - an ICBM message ID to attach to this message
wantsIcon - whether or not to request the receiver's buddy icon
iconInfo - a block of buddy icon hash information to "advertise" to the receiver
expInfoBlocks - a list of AIM Expression information blocks
ackRequested - whether a MessageAck should be sent in response to this command
Method Detail

getScreenname

public final java.lang.String getScreenname()
Returns the screenname to whom this message is to be sent.

Returns:
the screenname of the recipient of this message

isAckRequested

public final boolean isAckRequested()
Returns whether or not a MessageAck was requested.

Returns:
whether or not a message acknowledgement packet was requested

writeChannelData

protected void writeChannelData(java.io.OutputStream out)
                         throws java.io.IOException
Description copied from class: AbstractIcbm
Writes the channel-specific data for this ICBM command to the given output stream.

Specified by:
writeChannelData in class AbstractIcbm
Parameters:
out - the stream to write to
Throws:
java.io.IOException - if an I/O error occurs