aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_selector/groupchat_row.vala
blob: 0dfdfe661c690d7a11c90d336b195149d69e32c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Dino.Entities;

namespace Dino.Ui.ConversationSelector {

public class GroupchatRow : ConversationRow {

    public GroupchatRow(StreamInteractor stream_interactor, Conversation conversation) {
        base(stream_interactor, conversation);
        has_tooltip = true;
        set_tooltip_text(conversation.counterpart.bare_jid.to_string());
        update_avatar();

        closed.connect(() => {
            stream_interactor.get_module(MucManager.IDENTITY).part(conversation.account, conversation.counterpart);
        });
        stream_interactor.get_module(MucManager.IDENTITY).left.connect(update_avatar);
    }

    protected override void update_message_label() {
        base.update_message_label();
        if (last_message != null) {
            nick_label.visible = true;
            nick_label.label = Util.get_message_display_name(stream_interactor, last_message, conversation.account) + ": ";
        }
    }
}

}