public class CarbonManager extends Manager
CarbonExtension
support, enabling and disabling
message carbons.
You should call enableCarbons() before sending your first undirected
presence.Modifier and Type | Method and Description |
---|---|
void |
disableCarbons()
Helper method to disable carbons.
|
static void |
disableCarbons(Message msg)
Mark a message as "private", so it will not be carbon-copied.
|
void |
enableCarbons()
Helper method to enable carbons.
|
static CarbonExtension |
getCarbon(Message msg)
Obtain a Carbon from a message, if available.
|
boolean |
getCarbonsEnabled()
Check if carbons are enabled on this connection.
|
static CarbonManager |
getInstanceFor(XMPPConnection connection)
Obtain the CarbonManager responsible for a connection.
|
boolean |
isSupportedByServer()
Returns true if XMPP Carbons are supported by the server.
|
void |
sendCarbonsEnabled(boolean new_state)
Notify server to change the carbons state.
|
void |
setCarbonsEnabled(boolean new_state)
Notify server to change the carbons state.
|
connection, schedule
public static CarbonManager getInstanceFor(XMPPConnection connection)
connection
- the connection object.public boolean isSupportedByServer() throws XMPPException, SmackException
SmackException
- if there was no response from the server.XMPPException
public void sendCarbonsEnabled(boolean new_state) throws SmackException.NotConnectedException
new_state
- whether carbons should be enabled or disabledSmackException.NotConnectedException
public void setCarbonsEnabled(boolean new_state) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
new_state
- whether carbons should be enabled or disabledXMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public void enableCarbons() throws XMPPException, SmackException
XMPPException
SmackException
- if there was no response from the server.public void disableCarbons() throws XMPPException, SmackException
XMPPException
SmackException
- if there was no response from the server.public boolean getCarbonsEnabled()
public static CarbonExtension getCarbon(Message msg)
msg
- Message object to check for carbonspublic static void disableCarbons(Message msg)
msg
- Message object to mark private