1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-23 19:18:00 +01:00

[carbons] Add CarbonExtension.Private.addTo(MessageBuilder), deprecate old

This commit is contained in:
Florian Schmaus 2020-05-21 22:44:14 +02:00
parent 33720e8d97
commit c4ad857c0d

View file

@ -18,6 +18,7 @@ package org.jivesoftware.smackx.carbons.packet;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.MessageBuilder;
import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jivesoftware.smackx.forward.packet.Forwarded;
@ -158,8 +159,21 @@ public class CarbonExtension implements ExtensionElement {
* Marks a message "private", so that it will not be carbon-copied, by adding private packet
* extension to the message.
*
* @param message the message to add the private extension to
* @param messageBuilder the message to add the private extension to
*/
public static void addTo(MessageBuilder messageBuilder) {
messageBuilder.addExtension(INSTANCE);
}
/**
* Marks a message "private", so that it will not be carbon-copied, by adding private packet
* extension to the message.
*
* @param message the message to add the private extension to
* @deprecated use {@link #addTo(MessageBuilder)} instead.
*/
// TODO: Remove in Smack 4.6
@Deprecated
public static void addTo(Message message) {
message.addExtension(INSTANCE);
}