[Merge] lp:~phablet-team/messaging-framework/add_support_for_handle_none into lp:messaging-framework

Gustavo Pichorim Boiko gustavo.boiko at canonical.com
Tue May 17 18:00:20 UTC 2016


Review: Needs Fixing

Just one thing to fix.

Diff comments:

> 
> === modified file 'src/messaging/qt/tp/connection.cpp'
> --- src/messaging/qt/tp/connection.cpp	2016-05-12 21:33:27 +0000
> +++ src/messaging/qt/tp/connection.cpp	2016-05-12 21:33:27 +0000
> @@ -164,14 +164,19 @@
>      personalChat.allowedProperties.append(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle"));
>      personalChat.allowedProperties.append(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetID"));
>  
> -    Tp::RequestableChannelClass groupChat;
> -    groupChat.fixedProperties[TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType")] = TP_QT_IFACE_CHANNEL_TYPE_TEXT;
> -    groupChat.fixedProperties[TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType")]  = Tp::HandleTypeRoom;
> -    groupChat.allowedProperties.append(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle"));
> -    groupChat.allowedProperties.append(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetID"));
> -    groupChat.allowedProperties.append(TP_QT_IFACE_CHANNEL_INTERFACE_CONFERENCE + QLatin1String(".InitialInviteeIDs"));
> -
> -    requests->requestableChannelClasses << personalChat << groupChat;
> +    Tp::RequestableChannelClass existingGroupChat;
> +    existingGroupChat.fixedProperties[TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType")] = TP_QT_IFACE_CHANNEL_TYPE_TEXT;
> +    existingGroupChat.fixedProperties[TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType")]  = Tp::HandleTypeRoom;
> +    existingGroupChat.allowedProperties.append(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle"));
> +    existingGroupChat.allowedProperties.append(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetID"));
> +
> +    Tp::RequestableChannelClass newGroupChat;
> +    newGroupChat.fixedProperties[TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType")] = TP_QT_IFACE_CHANNEL_TYPE_TEXT;
> +    newGroupChat.fixedProperties[TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType")]  = Tp::HandleTypeNone;
> +    newGroupChat.allowedProperties.append(TP_QT_IFACE_CHANNEL_INTERFACE_CONFERENCE + QLatin1String(".InitialInviteeIDs"));

Group initiator and server yes. Group title needs to be set after the channel is created (if I understood the spec correctly)

> +
> +    requests->requestableChannelClasses << personalChat << existingGroupChat << newGroupChat;
> +
>      plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(requests));
>  
>      contacts = Tp::BaseConnectionContactsInterface::create();
> @@ -475,11 +481,12 @@
>                      //FIXME: get contact attribute display name for the user second param
>                      initial_invitees.push_back(std::make_shared<User>(initial_invitee_id.toStdString(), std::string{}/* display_name*/ ));
>                  }
> +                target_handle_type = Tp::HandleTypeRoom;

You should only set the handle type to Room if the RoomName property is present (even if it is just set to empty string)

>              }
>  
>              //FIXME: fill group title parameter when got somehow
>              recipient = std::make_shared<messaging::Group>(
> -                        group_handles_.left.find(target_handle)->second.toLatin1().data(),
> +                        std::string{} /* no id exists yet */,
>                          initial_invitees,
>                          std::string{} /* group title*/);
>              break;


-- 
https://code.launchpad.net/~phablet-team/messaging-framework/add_support_for_handle_none/+merge/294570
Your team Ubuntu Phablet Team is subscribed to branch lp:~phablet-team/messaging-framework/fix-group-creation-and-provide-groupid-in-advance.



More information about the Ubuntu-reviews mailing list