Merge lp:~super-friends/unity-lens-friends/raring into lp:unity-lens-friends

Proposed by Ken VanDine
Status: Merged
Approved by: Ken VanDine
Approved revision: 47
Merged at revision: 47
Proposed branch: lp:~super-friends/unity-lens-friends/raring
Merge into: lp:unity-lens-friends
Diff against target: 262 lines (+99/-98)
4 files modified
debian/changelog (+8/-0)
debian/control (+3/-1)
src/daemon.vala (+81/-95)
src/schemas.vala (+7/-2)
To merge this branch: bzr merge lp:~super-friends/unity-lens-friends/raring
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Review via email: mp+154375@code.launchpad.net

Description of the change

Merge queued up changes for raring to trunk now that the FFe bug 1156979 was approved

To post a comment you must log in.
Revision history for this message
Ken VanDine (ken-vandine) wrote :

This was reviewed before merging into the raring branch

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2013-02-25 15:18:38 +0000
+++ debian/changelog 2013-03-20 13:50:55 +0000
@@ -1,3 +1,11 @@
1unity-lens-friends (0.1.1bzr13.03.20-0ubuntu1) UNRELEASED; urgency=low
2
3 * Ported to the flatter schema
4 * debian/control
5 - depend on friends (>= 0.1.3) for schema changes (LP: #1156941)
6
7 -- Ken VanDine <ken.vandine@canonical.com> Thu, 14 Mar 2013 10:12:48 -0400
8
1unity-lens-friends (0.1.1bzr13.02.25-0ubuntu1) raring; urgency=low9unity-lens-friends (0.1.1bzr13.02.25-0ubuntu1) raring; urgency=low
210
3 * Dropped src/stream-model-schema.vala, the schema is defined 11 * Dropped src/stream-model-schema.vala, the schema is defined
412
=== modified file 'debian/control'
--- debian/control 2013-02-22 00:09:33 +0000
+++ debian/control 2013-03-20 13:50:55 +0000
@@ -19,7 +19,9 @@
1919
20Package: unity-lens-friends20Package: unity-lens-friends
21Architecture: any21Architecture: any
22Depends: ${shlibs:Depends}, ${misc:Depends}22Depends: ${shlibs:Depends},
23 ${misc:Depends},
24 friends (>= 0.1.3),
23Description: Friends Lens for unity25Description: Friends Lens for unity
24 This package contains the "friends" lens which can be used26 This package contains the "friends" lens which can be used
25 in Unity to view streams from Friends.27 in Unity to view streams from Friends.
2628
=== modified file 'src/daemon.vala'
--- src/daemon.vala 2013-02-14 14:13:05 +0000
+++ src/daemon.vala 2013-03-20 13:50:55 +0000
@@ -521,14 +521,9 @@
521521
522 if (account_ids.size > 0)522 if (account_ids.size > 0)
523 {523 {
524 var _message_ids = model.get_value (iter, StreamModelColumn.MESSAGE_IDS);524 var _account = (uint)model.get_uint64 (iter, StreamModelColumn.ACCOUNT_ID);
525 foreach (var _message_id in _message_ids)525 if (!(_account.to_string() in account_ids))
526 {526 account_match = false;
527 var _message_id_item = (string[])_message_id;
528 var _account = _message_id_item[1];
529 if (!(_account in account_ids))
530 account_match = false;
531 }
532 }527 }
533528
534 var _stream = model.get_string (iter, StreamModelColumn.STREAM);529 var _stream = model.get_string (iter, StreamModelColumn.STREAM);
@@ -635,7 +630,7 @@
635 var avatar = Icon.new_for_string (icon_uri);630 var avatar = Icon.new_for_string (icon_uri);
636631
637 //var avatar = new FileIcon (File.new_for_path (get_avatar_path (icon_uri)));632 //var avatar = new FileIcon (File.new_for_path (get_avatar_path (icon_uri)));
638 var likes = model.get_double (iter, StreamModelColumn.LIKES);633 var likes = model.get_uint64 (iter, StreamModelColumn.LIKES);
639 var sender = model.get_string (iter, StreamModelColumn.SENDER);634 var sender = model.get_string (iter, StreamModelColumn.SENDER);
640 var timestring = utils.create_time_string (model.get_string (iter, StreamModelColumn.TIMESTAMP));635 var timestring = utils.create_time_string (model.get_string (iter, StreamModelColumn.TIMESTAMP));
641 var content = model.get_string (iter, StreamModelColumn.MESSAGE);636 var content = model.get_string (iter, StreamModelColumn.MESSAGE);
@@ -661,96 +656,87 @@
661 iter = model.next (iter);656 iter = model.next (iter);
662 }657 }
663658
664 uint[] _seen = null;659 uint _account_id = (uint)model.get_uint64(iter, StreamModelColumn.ACCOUNT_ID);
665 var _message_ids = model.get_value (iter, StreamModelColumn.MESSAGE_IDS);660 debug ("account_id: %u", _account_id);
666 foreach (var _message_id in _message_ids)661 var _account_service = model.get_string (iter, StreamModelColumn.PROTOCOL);
667 {662 var _status_id = model.get_string (iter, StreamModelColumn.MESSAGE_ID);
668 var _message_id_item = (string[])_message_id;663 var icon_str = icon_dir.get_child ("service-" + _account_service + ".svg");
669 uint _account_id = (uint)uint64.parse(_message_id_item[1]);664 if (icon_str.query_exists ())
670 debug ("account_id: %u", _account_id);665 icon = new FileIcon (icon_str);
671 if (_account_id in _seen)666 else
672 continue;667 icon = null;
673 _seen += _account_id;668
674 var _account_service = _message_id_item[0];669 string[] _features = null;
675 var _status_id = _message_id_item[2];670 if (featureMap.has_key(_account_service))
676 var icon_str = icon_dir.get_child ("service-" + _account_service + ".svg");671 {
677 if (icon_str.query_exists ())672 _features = featureMap[_account_service].dup_strv ();
678 icon = new FileIcon (icon_str);673 }
679 else674
680 icon = null;675 parse_comments (preview, _status_id);
681676
682 string[] _features = null;677 var view_action = new Unity.PreviewAction ("view", _("View"), icon);
683 if (featureMap.has_key(_account_service))678 preview.add_action (view_action);
684 {679
685 _features = featureMap[_account_service].dup_strv ();680 view_action.activated.connect ((source) => {
686 }681 try
687682 {
688 parse_comments (preview, _status_id);683 if (GLib.AppInfo.launch_default_for_uri (uri, null))
689684 {
690 var view_action = new Unity.PreviewAction ("view", _("View"), icon);685 return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH);
691 preview.add_action (view_action);686 }
692687 }
693 view_action.activated.connect ((source) => {688 catch (GLib.Error e)
694 try689 {
695 {690 warning ("Failed to launch default application for uri '%s': %s", uri, e.message);
696 if (GLib.AppInfo.launch_default_for_uri (uri, null))691 }
697 {692 return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED);
698 return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH);693 });
699 }694
700 }695 if ("retweet" in _features)
701 catch (GLib.Error e)696 {
702 {697 if (_account_service == "twitter")
703 warning ("Failed to launch default application for uri '%s': %s", uri, e.message);698 retweet_str = _("Retweet");
704 }699 else
705 return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED);700 retweet_str = _("Share");
701 var retweet_action = new Unity.PreviewAction ("retweet", retweet_str, icon);
702 preview.add_action (retweet_action);
703 retweet_action.activated.connect ((source) => {
704 Idle.add (() => {
705 var dispatcher = new Friends.Dispatcher ();
706 dispatcher.retweet (_account_id, _status_id);
707 return false;
708 });
709 return new Unity.ActivationResponse (Unity.HandledType.SHOW_PREVIEW);
706 });710 });
707711 }
708 if ("retweet" in _features)
709 {
710 if (_account_service == "twitter")
711 retweet_str = _("Retweet");
712 else
713 retweet_str = _("Share");
714 var retweet_action = new Unity.PreviewAction ("retweet", retweet_str, icon);
715 preview.add_action (retweet_action);
716 retweet_action.activated.connect ((source) => {
717 Idle.add (() => {
718 var dispatcher = new Friends.Dispatcher ();
719 dispatcher.retweet (_account_id, _status_id);
720 return false;
721 });
722 return new Unity.ActivationResponse (Unity.HandledType.SHOW_PREVIEW);
723 });
724 }
725 712
726 bool from_me = model.get_bool (iter, StreamModelColumn.FROM_ME);713 bool from_me = model.get_bool (iter, StreamModelColumn.FROM_ME);
727 // REPLY714 // REPLY
728 //if ("reply" in _features && !from_me)715 //if ("reply" in _features && !from_me)
729 //{716 //{
730 // var reply_action = new Unity.PreviewAction ("reply", _("Reply"), icon);717 // var reply_action = new Unity.PreviewAction ("reply", _("Reply"), icon);
731 // preview.add_action (reply_action);718 // preview.add_action (reply_action);
732 // reply_action.activated.connect ((source) => {719 // reply_action.activated.connect ((source) => {
733 // return new Unity.ActivationResponse(Unity.HandledType.HIDE_DASH);720 // return new Unity.ActivationResponse(Unity.HandledType.HIDE_DASH);
734 // });721 // });
735 //}722 //}
736723
737 bool liked = model.get_bool (iter, StreamModelColumn.LIKED);724 bool liked = model.get_bool (iter, StreamModelColumn.LIKED);
738 if ("like" in _features && "unlike" in _features && !from_me)725 if ("like" in _features && "unlike" in _features && !from_me)
739 {726 {
740 like_str = liked ? _("Unlike") : _("Like");727 like_str = liked ? _("Unlike") : _("Like");
741 var like_action = new Unity.PreviewAction ("like", like_str, icon);728 var like_action = new Unity.PreviewAction ("like", like_str, icon);
742 preview.add_action (like_action);729 preview.add_action (like_action);
743 like_action.activated.connect ((source) => {730 like_action.activated.connect ((source) => {
744 Idle.add (() => {731 Idle.add (() => {
745 var dispatcher = new Friends.Dispatcher ();732 var dispatcher = new Friends.Dispatcher ();
746 var ret = liked ? dispatcher.unlike (_account_id, _status_id) : dispatcher.like (_account_id, _status_id);733 var ret = liked ? dispatcher.unlike (_account_id, _status_id) : dispatcher.like (_account_id, _status_id);
747 return false;734 return false;
748 });
749 model.set_value (iter, StreamModelColumn.LIKED, !liked);
750 Unity.Preview new_preview = this.preview (uri);
751 return new Unity.ActivationResponse.with_preview (new_preview);
752 });735 });
753 }736 model.set_value (iter, StreamModelColumn.LIKED, !liked);
737 Unity.Preview new_preview = this.preview (uri);
738 return new Unity.ActivationResponse.with_preview (new_preview);
739 });
754 }740 }
755741
756 return preview;742 return preview;
757743
=== modified file 'src/schemas.vala'
--- src/schemas.vala 2013-02-25 15:09:57 +0000
+++ src/schemas.vala 2013-03-20 13:50:55 +0000
@@ -51,7 +51,9 @@
51 /* Dee.Model schema */51 /* Dee.Model schema */
52 public enum StreamModelColumn52 public enum StreamModelColumn
53 {53 {
54 MESSAGE_IDS,54 PROTOCOL,
55 ACCOUNT_ID,
56 MESSAGE_ID,
55 STREAM,57 STREAM,
56 SENDER,58 SENDER,
57 SENDER_ID,59 SENDER_ID,
@@ -68,7 +70,10 @@
68 LINK_URL,70 LINK_URL,
69 LINK_DESC,71 LINK_DESC,
70 LINK_CAPTION,72 LINK_CAPTION,
71 LINK_ICON73 LINK_ICON,
74 LOCATION,
75 LATITUDE,
76 LONGITUDE
72 }77 }
7378
74} /* end UnityFriends namespace */79} /* end UnityFriends namespace */

Subscribers

People subscribed via source and target branches

to all changes: