aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/ui/conversation_summary/merged_status_item.vala
blob: 78b156e92ad8b5a1a735e482b8541237b6d173bc (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
29
30
using Gee;
using Gtk;

using Dino.Entities;

namespace Dino.Ui.ConversationSummary {

private class MergedStatusItem : Expander {

    private StreamInteractor stream_interactor;
    private Conversation conversation;
    private ArrayList<Show> statuses = new ArrayList<Show>();

    public MergedStatusItem(StreamInteractor stream_interactor, Conversation conversation, Show show) {
        set_hexpand(true);
        add_status(show);
    }

    public void add_status(Show show) {
        statuses.add(show);
        StatusItem status_item = new StatusItem(stream_interactor, conversation, @"is $(show.as)");
        if (statuses.size == 1) {
            label = show.as;
        } else {
            label = @"changed their status $(statuses.size) times";
            add(new Label(show.as));
        }
    }
}
}