ChannelSearchResult.java

 1package eu.siacs.conversations.entities;
 2
 3import eu.siacs.conversations.services.AvatarService;
 4import eu.siacs.conversations.utils.UIHelper;
 5import rocks.xmpp.addr.Jid;
 6
 7public class ChannelSearchResult implements AvatarService.Avatarable {
 8
 9    private final String name;
10    private final String description;
11    private final Jid room;
12
13    public String getName() {
14        return name;
15    }
16
17    public String getDescription() {
18        return description;
19    }
20
21    public Jid getRoom() {
22        return room;
23    }
24
25    public ChannelSearchResult(String name, String description, Jid room) {
26        this.name = name;
27        this.description = description;
28        this.room = room;
29    }
30
31    @Override
32    public int getAvatarBackgroundColor() {
33        return UIHelper.getColorForName(room != null ? room.asBareJid().toEscapedString() : getName());
34    }
35}