[Merge] lp:~phablet-team/messaging-framework/avoid-update-self-member-in-plugin into lp:messaging-framework

Tiago Salem Herrmann tiago.herrmann at canonical.com
Tue Aug 23 20:53:50 UTC 2016


Review: Needs Information

just a comment.

Diff comments:

> === modified file 'src/messaging/qt/tp/text_channel.cpp'
> --- src/messaging/qt/tp/text_channel.cpp	2016-08-16 15:10:00 +0000
> +++ src/messaging/qt/tp/text_channel.cpp	2016-08-23 20:49:30 +0000
> @@ -820,6 +820,17 @@
>  
>      try
>      {
> +        // avoid including self handle as member to add in server
> +        Tp::UIntList handles_without_self;
> +        for (uint handle: handles) {

can't you just do a handles.removeAll(tp_connection->selfHandle()) instead of iterating the entire list?

> +            if (handle != tp_connection->selfHandle()) {
> +                handles_without_self << handle;
> +            }
> +        }
> +        if (handles_without_self.size() == 0) {
> +            return;
> +        }
> +
>          std::shared_ptr<messaging::GroupManager> group_manager = chat->interface<GroupManager>();
>  
>          if (!group_manager) {
> @@ -849,6 +860,17 @@
>  
>      try
>      {
> +        // avoid including self handle as member to remove in server
> +        Tp::UIntList handles_without_self;
> +        for (uint handle: handles) {
> +            if (handle != tp_connection->selfHandle()) {

same here

> +                handles_without_self << handle;
> +            }
> +        }
> +        if (handles_without_self.size() == 0) {
> +            return;
> +        }
> +
>          std::shared_ptr<messaging::GroupManager> group_manager = chat->interface<GroupManager>();
>  
>          if (!group_manager) {


-- 
https://code.launchpad.net/~phablet-team/messaging-framework/avoid-update-self-member-in-plugin/+merge/303741
Your team Ubuntu Phablet Team is subscribed to branch lp:messaging-framework.



More information about the Ubuntu-reviews mailing list