~phablet-team/messaging-framework/maintain-connection-state

« back to all changes in this revision

Viewing changes to src/messaging/qt/tp/text_channel.cpp

  • Committer: Tarmac
  • Author(s): Roberto Mier Escandon
  • Date: 2016-08-23 22:12:02 UTC
  • mfrom: (54.1.6 include-group-creator)
  • Revision ID: tarmac-20160823221202-xp8p4pcb6fwp5jar
Added creator to the group when created the channel.

NOTE: this branch should be landed along with https://code.launchpad.net/~ningbo-team/ningbo/include-group-creator/+merge/303179.

Approved by Tiago Salem Herrmann, system-apps-ci-bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
327
327
        messaging::Group::shared_ptr group = std::dynamic_pointer_cast<messaging::Group>(recipient);
328
328
        // FIXME: we need to expose the extra information (like server and creator) in the group class.
329
329
 
 
330
        Tp::DBusError error;
 
331
        uint creator_handle = tp_connection->requestHandles(Tp::HandleTypeContact,
 
332
                                                            QStringList() << QString::fromStdString(group->creator()->id()),
 
333
                                                            &error)[0];
 
334
        if (error.isValid())
 
335
        {
 
336
            LOG(ERROR) << "Could not get creator handle";
 
337
            return;
 
338
        }
 
339
 
330
340
        // uncomment the following code when room name is part of messaging::Group
331
341
        //QString roomName = QString::fromStdString(group->id());
332
342
        room_interface = Tp::BaseChannelRoomInterface::create(/* roomName */ QString(),
333
343
                                                    /* serverName */ QString(),
334
 
                                                    /* creator */ QString(),
335
 
                                                    /* creatorHandle */ 0,
 
344
                                                    /* creator */ QString::fromStdString(group->creator()->id()),
 
345
                                                    /* creatorHandle */ creator_handle,
336
346
                                                    /* creationTimestamp */ QDateTime());
337
347
        room_config_interface = Tp::BaseChannelRoomConfigInterface::create();
338
348
 
754
764
 
755
765
QString mqt::tp::TextChannel::send_message(const Tp::MessagePartList& message, uint flags, Tp::DBusError* error)
756
766
{
757
 
    //TODO TRACE
758
767
    LOG(INFO) << __PRETTY_FUNCTION__;
759
768
 
760
769
    Q_UNUSED(flags)