birdie-team team mailing list archive
-
birdie-team team
-
Mailing list archive
-
Message #00122
[Merge] lp:~vasco-m-nunes/birdie/birdie-verified-accounts into lp:birdie
vasco has proposed merging lp:~vasco-m-nunes/birdie/birdie-verified-accounts into lp:birdie.
Requested reviews:
Birdie Developers (birdie-team)
For more details, see:
https://code.launchpad.net/~vasco-m-nunes/birdie/birdie-verified-accounts/+merge/157257
--
https://code.launchpad.net/~vasco-m-nunes/birdie/birdie-verified-accounts/+merge/157257
Your team Birdie Developers is requested to review the proposed merge of lp:~vasco-m-nunes/birdie/birdie-verified-accounts into lp:birdie.
=== modified file 'icons/CMakeLists.txt'
--- icons/CMakeLists.txt 2013-04-02 21:44:58 +0000
+++ icons/CMakeLists.txt 2013-04-05 00:09:21 +0000
@@ -21,6 +21,7 @@
install(FILES 32x32/apps/birdie.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/32x32/apps)
install(FILES 48x48/apps/birdie.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps)
install(FILES 64x64/apps/birdie.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/64x64/apps)
+install(FILES twitter-verified.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/22x22/emblems)
install(
=== added file 'icons/twitter-verified.png'
Binary files icons/twitter-verified.png 1970-01-01 00:00:00 +0000 and icons/twitter-verified.png 2013-04-05 00:09:21 +0000 differ
=== modified file 'src/Identica.vala'
--- src/Identica.vala 2013-04-02 22:59:27 +0000
+++ src/Identica.vala 2013-04-05 00:09:21 +0000
@@ -464,7 +464,7 @@
media_url = "";
}
- return new Tweet (id, actual_id, user_name, user_screen_name, text, created_at, profile_image_url, profile_image_file, retweeted, favorited, false, in_reply_to_screen_name, retweeted_by, retweeted_by_name, media_url);
+ return new Tweet (id, actual_id, user_name, user_screen_name, text, created_at, profile_image_url, profile_image_file, retweeted, favorited, false, in_reply_to_screen_name, retweeted_by, retweeted_by_name, media_url, false);
}
=== modified file 'src/Tweet.vala'
--- src/Tweet.vala 2013-04-01 23:30:27 +0000
+++ src/Tweet.vala 2013-04-05 00:09:21 +0000
@@ -31,8 +31,9 @@
public bool favorited;
public bool dm;
public string media_url;
+ public bool verified;
- public Tweet (string id = "", string actual_id = "", string user_name = "", string user_screen_name = "", string text = "", string created_at = "", string profile_image_url = "", string profile_image_file = "", bool retweeted = false, bool favorited = false, bool dm = false, string in_reply_to_screen_name = "", string retweeted_by = "", string retweeted_by_name = "", string media_url = "") {
+ public Tweet (string id = "", string actual_id = "", string user_name = "", string user_screen_name = "", string text = "", string created_at = "", string profile_image_url = "", string profile_image_file = "", bool retweeted = false, bool favorited = false, bool dm = false, string in_reply_to_screen_name = "", string retweeted_by = "", string retweeted_by_name = "", string media_url = "", bool verified = false) {
this.id = id;
this.actual_id = actual_id;
this.user_name = user_name;
@@ -48,6 +49,7 @@
this.retweeted_by = retweeted_by;
this.retweeted_by_name = retweeted_by_name;
this.media_url = media_url;
+ this.verified = verified;
}
}
}
=== modified file 'src/Twitter.vala'
--- src/Twitter.vala 2013-04-02 22:13:06 +0000
+++ src/Twitter.vala 2013-04-05 00:09:21 +0000
@@ -263,10 +263,11 @@
int64 friends_count = userobject.get_int_member ("friends_count");
int64 followers_count = userobject.get_int_member ("followers_count");
int64 statuses_count = userobject.get_int_member ("statuses_count");
+ bool verified = userobject.get_boolean_member ("verified");
account = new User (id, name, screen_name,
profile_image_url, profile_image_file, location, desc,
- friends_count, followers_count, statuses_count
+ friends_count, followers_count, statuses_count, verified
);
} catch (Error e) {
@@ -301,10 +302,11 @@
int64 friends_count = tweetobject.get_object_member ("user").get_int_member ("friends_count");
int64 followers_count = tweetobject.get_object_member ("user").get_int_member ("followers_count");
int64 statuses_count = tweetobject.get_object_member ("user").get_int_member ("statuses_count");
+ bool verified = tweetobject.get_object_member ("user").get_boolean_member ("verified");
this.user = new User (id, name, screen_name,
profile_image_url, profile_image_file, location, description,
- friends_count, followers_count, statuses_count
+ friends_count, followers_count, statuses_count, verified
);
}
@@ -435,6 +437,7 @@
var text = highligh_links(tweetobject.get_string_member ("text"));
var created_at = tweetobject.get_string_member ("created_at");
var profile_image_url = tweetobject.get_object_member ("user").get_string_member ("profile_image_url");
+ var verified = tweetobject.get_object_member ("user").get_boolean_member ("verified");
var profile_image_file = get_avatar (profile_image_url);
var in_reply_to_screen_name = tweetobject.get_string_member ("in_reply_to_screen_name");
@@ -455,7 +458,7 @@
media_url = "";
}
- return new Tweet (id, actual_id, user_name, user_screen_name, text, created_at, profile_image_url, profile_image_file, retweeted, favorited, false, in_reply_to_screen_name, retweeted_by, retweeted_by_name, media_url);
+ return new Tweet (id, actual_id, user_name, user_screen_name, text, created_at, profile_image_url, profile_image_file, retweeted, favorited, false, in_reply_to_screen_name, retweeted_by, retweeted_by_name, media_url, verified);
}
public override int get_home_timeline () {
=== modified file 'src/User.vala'
--- src/User.vala 2013-03-23 15:29:26 +0000
+++ src/User.vala 2013-04-05 00:09:21 +0000
@@ -26,12 +26,14 @@
public int64 friends_count;
public int64 followers_count;
public int64 statuses_count;
+ public bool verified;
public User (string id = "", string name = "",
string screen_name = "", string profile_image_url = "",
string profile_image_file = "", string location = "",
string desc = "", int64 friends_count = 0,
- int64 followers_count = 0, int64 statuses_count = 0
+ int64 followers_count = 0, int64 statuses_count = 0,
+ bool verified = false
) {
this.id = id;
@@ -44,6 +46,7 @@
this.friends_count = friends_count;
this.followers_count = followers_count;
this.statuses_count = statuses_count;
+ this.verified = verified;
}
}
}
=== modified file 'src/Widgets/TweetBox.vala'
--- src/Widgets/TweetBox.vala 2013-04-04 19:24:43 +0000
+++ src/Widgets/TweetBox.vala 2013-04-05 00:09:21 +0000
@@ -47,6 +47,8 @@
private Gtk.Image media;
private Gdk.Pixbuf media_pixbuf;
private Gtk.Image full_image;
+ private Gtk.Image verified_img;
+
private int year;
private int month;
@@ -116,6 +118,7 @@
// header box
this.header_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
this.content_box.pack_start (this.header_box, false, false, 0);
+ this.verified_img = new Gtk.Image ();
// show symbols properly in user label
if ("&" in tweet.user_name)
@@ -127,14 +130,24 @@
if (" >" in tweet.text)
tweet.text = tweet.text.replace (" >", ">");
+ if (tweet.verified) {
+ this.verified_img = new Gtk.Image ();
+ this.verified_img.set_from_icon_name ("twitter-verified", Gtk.IconSize.MENU);
+ this.verified_img.set_halign (Gtk.Align.END);
+ this.header_box.pack_start (this.verified_img, false, true, 0);
+ }
+
// user label
this.username_label = new Gtk.Label ("");
this.username_label.set_halign (Gtk.Align.START);
this.username_label.set_valign (Gtk.Align.START);
this.username_label.set_selectable (true);
- this.username_label.set_markup ("<span underline='none' color='#000' font_weight='bold' size='large'><a href='birdie://user/" +
- tweet.user_screen_name + "'>" + tweet.user_name +
- "</a></span> <span font_weight='light' color='#aaa'>@" + tweet.user_screen_name + "</span>");
+ this.username_label.set_markup (
+ "<span underline='none' color='#000' font_weight='bold' size='large'><a href='birdie://user/" +
+ tweet.user_screen_name + "'>" + tweet.user_name +
+ "</a></span> <span font_weight='light' color='#aaa'>@" +
+ tweet.user_screen_name + "</span>"
+ );
//FIXME: Set ellipsis mode
this.header_box.pack_start (this.username_label, false, true, 0);
@@ -371,9 +384,7 @@
this.status_img.set_from_icon_name ("twitter-favret-banner", Gtk.IconSize.LARGE_TOOLBAR);
} else {
this.context_overlay.remove (this.buttons_alignment);
-
this.status_img.set_from_icon_name("twitter-fav-banner", Gtk.IconSize.LARGE_TOOLBAR);
-
this.context_overlay.add_overlay (this.status_img);
this.context_overlay.add_overlay (this.buttons_alignment);
this.status_img.show ();
@@ -491,9 +502,9 @@
var retweeted_by_label = "";
retweeted_by_label = ("<span color='#aaa'>" +
- _("retweeted by %s").printf ("<span underline='none'><a href='birdie://user/" +
- this.tweet.retweeted_by + "'>" + this.tweet.retweeted_by_name
- + "</a></span>") + "</span>");
+ _("retweeted by %s").printf ("<span underline='none'><a href='birdie://user/" +
+ this.tweet.retweeted_by + "'>" + this.tweet.retweeted_by_name +
+ "</a></span>") + "</span>");
if (this.tweet.retweeted_by != "") {
var retweeted_img = new Gtk.Image ();
@@ -506,9 +517,9 @@
if (birdie.service == 1)
retweeted_by_label = ("<span color='#aaa'>" +
- _("repeated by %s").printf ("<span underline='none'><a href='birdie://user/" +
- this.tweet.retweeted_by + "'>" + this.tweet.retweeted_by_name +
- "</a></span>") + "</span>");
+ _("repeated by %s").printf ("<span underline='none'><a href='birdie://user/" +
+ this.tweet.retweeted_by + "'>" + this.tweet.retweeted_by_name +
+ "</a></span>") + "</span>");
this.info_label.set_markup ("<span color='#aaa'>" + retweeted_by_label + "</span>");
avatar_box.pack_start (retweeted_img, false, false, 0);
@@ -522,10 +533,10 @@
this.info_label = new Gtk.Label ("");
this.info_label.set_halign (Gtk.Align.START);
this.info_label.margin_bottom = 6;
- var in_reply_label = ("<span color='#aaa'>"
- + _("in reply to @%s").printf ("<span underline='none'><a href='birdie://user/" +
- this.tweet.in_reply_to_screen_name + "'>" +
- this.tweet.in_reply_to_screen_name + "</a></span>") + "</span>");
+ var in_reply_label = ("<span color='#aaa'>" +
+ _("in reply to @%s").printf ("<span underline='none'><a href='birdie://user/" +
+ this.tweet.in_reply_to_screen_name + "'>" +
+ this.tweet.in_reply_to_screen_name + "</a></span>") + "</span>");
this.info_label.set_markup (in_reply_label);
avatar_box.pack_start (reply_img, false, false, 0);
=== modified file 'src/Widgets/UserBox.vala'
--- src/Widgets/UserBox.vala 2013-04-02 20:08:26 +0000
+++ src/Widgets/UserBox.vala 2013-04-05 00:09:21 +0000
@@ -35,6 +35,7 @@
private Gtk.Button unfollow_button;
private Gtk.Button block_button;
private Gtk.Button unblock_button;
+ private Gtk.Image verified_img;
public UserBox () {
GLib.Object (orientation: Gtk.Orientation.HORIZONTAL);
@@ -93,6 +94,13 @@
string tweets_txt;
+ if (user.verified) {
+ this.verified_img = new Gtk.Image ();
+ this.verified_img.set_from_icon_name ("twitter-verified", Gtk.IconSize.MENU);
+ this.verified_img.set_halign (Gtk.Align.END);
+ this.content_box.pack_start (this.verified_img, false, true, 0);
+ }
+
this.username_label.set_markup ("<span underline='none' color='#000000' font_weight='bold' size='large'>" + user.name + "</span> <span font_weight='light' color='#aaaaaa'>@" + user.screen_name + "</span>\n" + "<span size='small'>" + user.location + "</span>");
this.content_box.pack_start (this.username_label, false, true, 0);
Follow ups