~singpolyma/cheogram-android

77740d2a0aa7dc50681450b1d94a134cc48f2ef0 — Stephen Paul Weber 11 months ago b80cacf
Can send nick as part of presence
1 files changed, 6 insertions(+), 2 deletions(-)

M src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
M src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java => src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java +6 -2
@@ 54,10 54,10 @@ public class PresenceGenerator extends AbstractGenerator {
    }

    public PresencePacket selfPresence(Account account, Presence.Status status) {
        return selfPresence(account, status, true);
        return selfPresence(account, status, true, null);
    }

    public PresencePacket selfPresence(final Account account, final Presence.Status status, final boolean personal) {
    public PresencePacket selfPresence(final Account account, final Presence.Status status, final boolean personal, final String nickname) {
        final PresencePacket packet = new PresencePacket();
        if (personal) {
            final String sig = account.getPgpSignature();


@@ 72,6 72,10 @@ public class PresenceGenerator extends AbstractGenerator {
                packet.addChild("x", "jabber:x:signed").setContent(sig);
            }
        }
        if (nickname != null) {
            Element nick = packet.addChild("nick", "http://jabber.org/protocol/nick");
            nick.setContent(nickname);
        }
        final String capHash = getCapHash(account);
        if (capHash != null) {
            Element cap = packet.addChild("c",