Tooth/src/Views/LocalView.vala

32 lines
884 B
Vala
Raw Normal View History

public class Tootle.LocalView : TimelineView {
2018-04-14 12:09:06 +00:00
public LocalView () {
2018-04-26 14:05:03 +00:00
base ("public");
2018-06-13 13:13:41 +00:00
notificator = new Notificator (get_stream ());
notificator.status_added.connect ((ref status) => {
if (settings.live_updates_public)
on_status_added (ref status);
});
2018-04-14 12:09:06 +00:00
}
public override string get_icon () {
2018-05-27 16:57:52 +00:00
return "document-open-recent-symbolic";
2018-04-14 12:09:06 +00:00
}
public override string get_name () {
2018-05-09 21:46:24 +00:00
return _("Local Timeline");
2018-04-14 12:09:06 +00:00
}
2018-04-26 14:05:03 +00:00
public override string get_url (){
2018-06-13 13:13:41 +00:00
var url = base.get_url ();
2018-04-26 14:05:03 +00:00
url += "&local=true";
return url;
}
2018-06-13 13:13:41 +00:00
protected Soup.Message get_stream () {
var url = "%s/api/v1/streaming/?stream=public:local&access_token=%s".printf (accounts.formal.instance, accounts.formal.token);
return new Soup.Message("GET", url);
}
2018-04-14 12:09:06 +00:00
}