I have made the following changes intended for :
  CE:Apps / qmlmessages

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/6788

Thank You,
John Brooks

[This message was auto-generated]

---

Request # 6788:

Messages from BOSS:

State: review at 2012-09-25T17:22:16 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:special:branches:CE:Apps / qmlmessages -> CE:Apps / qmlmessages
  
changes files:
--------------
--- qmlmessages.changes
+++ qmlmessages.changes
@@ -0,0 +1,8 @@
+* Tue Sep 25 2012 John Brooks <[email protected]> - 0.0.5
+- Clean up QML and improve scrolling performance (from Robin Burchell)
+- Fixes NEMO#368: Long text labels overflow in UI
+- Redesigned text input to add wrapping and hold the VKB open
+- Fixed a crash when opening a group for a deleted telepathy account
+- Fixes NEMO#369: Notifications are shown for the active chat window
+- Use newer header location for telepathy-qt
+

old:
----
  qmlmessages-0.0.4.tar.bz2

new:
----
  qmlmessages-0.0.5.tar.bz2

spec files:
-----------
--- qmlmessages.spec
+++ qmlmessages.spec
@@ -9,7 +9,7 @@
 # << macros
 
 Summary:    Messaging application for nemo
-Version:    0.0.4
+Version:    0.0.5
 Release:    1
 Group:      Applications/System
 License:    BSD
@@ -24,6 +24,7 @@
 BuildRequires:  pkgconfig(qdeclarative-boostable)
 BuildRequires:  pkgconfig(TelepathyQt4)
 BuildRequires:  pkgconfig(commhistory)
+BuildRequires:  pkgconfig(contextprovider-1.0)
 BuildRequires:  desktop-file-utils
 Provides:   meego-handset-sms > 0.1.2
 Provides:   meego-handset-sms-branding-upstream > 0.1.2
@@ -74,6 +75,11 @@
   --dir %{buildroot}%{_datadir}/applications             \
    %{buildroot}%{_datadir}/applications/*.desktop
 
+%post
+# >> post
+update-contextkit-providers
+# << post
+
 %files
 %defattr(-,root,root,-)
 %{_bindir}/qmlmessages
@@ -81,5 +87,6 @@
 %{_datadir}/telepathy/clients/qmlmessages.client
 
%{_datadir}/dbus-1/services/org.freedesktop.Telepathy.Client.qmlmessages.service
 %{_datadir}/dbus-1/services/org.nemomobile.qmlmessages.service
+%{_datadir}/contextkit/providers/org.nemomobile.qmlmessages.context.context
 # >> files
 # << files

other changes:
--------------

++++++ qmlmessages-0.0.4.tar.bz2 -> qmlmessages-0.0.5.tar.bz2
--- data/data.pri
+++ data/data.pri
@@ -8,4 +8,7 @@
 service.files = data/org.freedesktop.Telepathy.Client.qmlmessages.service \
                 data/org.nemomobile.qmlmessages.service
 
-INSTALLS += desktop client service
+context.path = $${INSTALL_ROOT}/usr/share/contextkit/providers
+context.files = data/org.nemomobile.qmlmessages.context.context
+
+INSTALLS += desktop client service context
--- data/org.nemomobile.qmlmessages.context.context
+++ data/org.nemomobile.qmlmessages.context.context
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<provider bus="session" service="org.nemomobile.qmlmessages.context">
+    <key name="Messaging.ObservedConversation" type="list"></key>
+</provider>
--- qml/qml.qrc
+++ qml/qml.qrc
@@ -10,5 +10,6 @@
         <file>qmlmessages/MessagesView.qml</file>
         <file>qmlmessages/TargetEditBox.qml</file>
         <file>qmlmessages/AccountSelector.qml</file>
+        <file>qmlmessages/ChatTextInput.qml</file>
     </qresource>
 </RCC>
--- qml/qmlmessages/ChatTextInput.qml
+++ qml/qmlmessages/ChatTextInput.qml
@@ -0,0 +1,105 @@
+/* Copyright (C) 2012 John Brooks <[email protected]>
+ * Copyright (C) 2011 Robin Burchell <[email protected]>
+ *
+ * You may use this file under the terms of the BSD license as follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Nemo Mobile nor the names of its contributors
+ *     may be used to endorse or promote products derived from this
+ *     software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import com.nokia.meego 1.0
+
+BorderImage {
+    id: textArea
+    height: textInput.height + (8*2)
+    source: "image://theme/meegotouch-toolbar-portrait-background"
+    border { left: 10; right: 10; top: 10; bottom: 10 }
+
+    property alias text: textInput.text
+
+    signal sendMessage
+
+    function clear() {
+        text = ""
+    }
+
+    /* See comment on InverseMouseArea */
+    FocusScope {
+        id: inputFocusScope
+        anchors.left: parent.left
+        anchors.leftMargin: UiConstants.ButtonSpacing
+        anchors.right: sendBtn.left
+        anchors.rightMargin: UiConstants.ButtonSpacing
+        y: 8
+
+        TextArea {
+            id: textInput
+            anchors.left: parent.left
+            anchors.right: parent.right
+            height: 52 /* UI.DEFAULT_FIELD.HEIGHT */
+
+            placeholderText: qsTr("Type a message")
+            wrapMode: TextEdit.Wrap
+            textFormat: TextEdit.PlainText
+        }
+    }
+
+    /* To keep the VKB open when the 'Send' button is clicked, but close it
+     * when clicked elsewhere, we have to disable TextArea's default behavior
+     * - which is to give focus to its parent - by wrapping it in a FocusScope
+     * (making that no-op), and implement the correct behavior here. */
+    InverseMouseArea {
+        anchors.fill: parent
+        enabled: inputContext.softwareInputPanelVisible
+        z: 100
+
+        onClickedOutside: {
+            textArea.focus = true
+            textInput.platformCloseSoftwareInputPanel();
+        }
+    }
+
+    Button {
+        id: sendBtn
+        anchors.right: parent.right
+        anchors.rightMargin: UiConstants.ButtonSpacing
+        anchors.bottom: parent.bottom
+        anchors.bottomMargin: 8
+
+        text: qsTr("Send")
+        enabled: textInput.text.length > 0
+
+        platformStyle: ButtonStyle {
+            buttonWidth: 100
+            background: "image://theme/meegotouch-button-inverted-background"
+            disabledBackground: background
+            textColor: "white"
+            disabledTextColor: "lightgray"
+        }
+
+        onClicked: sendMessage(text)
+    }
+}
--- qml/qmlmessages/ConversationListDelegate.qml
+++ qml/qmlmessages/ConversationListDelegate.qml
@@ -32,7 +32,7 @@
 import QtQuick 1.1
 import com.nokia.meego 1.0
 
-Item {
+MouseArea {
     id: root
 
     height: photo.height + itemMargins
@@ -40,11 +40,10 @@
     anchors.right: parent.right
     anchors.leftMargin: itemMargins
     anchors.rightMargin: itemMargins
+    opacity: pressed ? 0.7 : 1.0
 
     property int itemMargins: 10
 
-    signal clicked
-
     Image {
         id: photo
         source: (model.avatarPath == undefined) ? 
"image://theme/icon-m-telephony-contact-avatar" : model.avatarPath
@@ -60,29 +59,25 @@
             verticalCenter: parent.verticalCenter
         }
 
-        Item {
-            width: parent.width
-            height: nameFirst.paintedHeight
-
-            Label {
-                id: nameFirst
-                text: model.remoteUids[0]
+        Label {
+            id: nameFirst
+            text: model.remoteUids[0]
+            width: parent.width - messageDate.paintedWidth
+            height: paintedHeight
+            elide: Text.ElideRight
 
-                platformStyle: LabelStyle {
-                    fontFamily: "Droid Sans"
-                    fontPixelSize: 30
-                }
+            platformStyle: LabelStyle {
+                fontPixelSize: 30
             }
 
             Label {
                 id: messageDate
                 // XXX This should be something more natural/useful
                 text: Qt.formatDateTime(model.lastModified, "M/d")
-                anchors.right: parent.right
+                anchors.left: parent.right
                 anchors.verticalCenter: parent.verticalCenter
 
                 platformStyle: LabelStyle {
-                    fontFamily: "Droid Sans"
                     fontPixelSize: 22
                     textColor: "#303030"
                 }
@@ -96,26 +91,10 @@
             width: parent.width
 
             platformStyle: LabelStyle {
-                fontFamily: "Droid Sans"
                 fontPixelSize: 20
                 textColor: "#4b4b4b"
             }
         }
     }
-
-
-    MouseArea {
-        id: mouseArea
-        anchors.fill: parent
-        onClicked: {
-            parent.clicked();
-        }
-    }
-
-    states: State {
-        name: "pressed"; when: mouseArea.pressed == true
-        PropertyChanges { target: root; opacity: .7}
-    }
-
 }
 
--- qml/qmlmessages/ConversationPage.qml
+++ qml/qmlmessages/ConversationPage.qml
@@ -65,16 +65,21 @@
 
         Text {
             id: label
-            anchors.centerIn: parent
+            anchors {
+                left: backBtn.right; right: avatar.left; top: parent.top; 
bottom: parent.bottom
+                leftMargin: 10; rightMargin: 10;
+            }
+            horizontalAlignment: Qt.AlignHCenter
+            verticalAlignment:  Qt.AlignVCenter
+
             elide: Text.ElideRight
             smooth: true
             color: "#111111"
-            text: channel == null ? "" : channel.contactId
             style: Text.Raised
             styleColor: "white"
-
-            font.family: "Droid Sans"
             font.pixelSize: 30
+
+            text: channel == null ? "" : channel.contactId
         }
 
         Image {
@@ -125,54 +130,21 @@
         }
     }
 
-    Image {
+    ChatTextInput {
         id: textArea
         anchors.bottom: parent.bottom
         anchors.left: parent.left
         anchors.right: parent.right
-        height: textInput.height + 22
 
-        source: "image://theme/meegotouch-toolbar-portrait-background"
+        onSendMessage: {
+            if (text.length < 1)
+                return
 
-        TextField {
-            id: textInput
-            anchors.left: parent.left
-            anchors.right: parent.right
-            anchors.leftMargin: 10
-            anchors.rightMargin: 10
-            y: 10
-            placeholderText: qsTr("Type a message")
+            if (conversationPage.state == "new" && targetEditor.text.length > 
0)
+                targetEditor.startConversation()
 
-            Button {
-                id: sendBtn
-                anchors.right: parent.right
-                anchors.rightMargin: 5
-                anchors.verticalCenter: textInput.verticalCenter
-                anchors.verticalCenterOffset: textInput.hasFocus ? 0 : 1
-
-                text: qsTr("Send")
-                enabled: textInput.text.length > 0
-                
-                platformStyle: ButtonStyle {
-                    buttonWidth: 100
-                    buttonHeight: textInput.height - 10
-                    background: 
"image://theme/meegotouch-button-inverted-background"
-                    disabledBackground: background
-                    textColor: "white"
-                    disabledTextColor: "lightgray"
-                }
-
-                onClicked: {
-                    if (conversationPage.state == "new" && 
targetEditor.text.length > 0) {
-                        targetEditor.startConversation()
-                    }
-
-                    if (textInput.text.length > 0) {
-                        channel.sendMessage(textInput.text)
-                        textInput.text = ""
-                    }
-                }
-            }
+            channel.sendMessage(text)
+            clear()
         }
     }
 
@@ -210,11 +182,6 @@
                 target: messagesView
                 anchors.top: targetEditor.bottom
             }
-
-            PropertyChanges {
-                target: sendBtn
-                enabled: textInput.text.length > 0 && targetEditor.text.length 
> 0
-            }
         }
     ]
 
--- qml/qmlmessages/MessagesView.qml
+++ qml/qmlmessages/MessagesView.qml
@@ -50,7 +50,7 @@
         onHeightChanged: view.positionViewAtBeginning()
 
         Connections {
-            target: model
+            target: model || null
             onRowsInserted: {
                 if (first == 0)
                     view.positionViewAtBeginning()
@@ -58,119 +58,44 @@
             onModelReset: view.positionViewAtBeginning()
         }
 
+        // Cannot use Label, because it shadows the 'style' property.
+        // Copy its text formatting instead.
+        LabelStyle {
+            id: labelStyle
+        }
+
         delegate: BorderImage {
             id: messageBox
+            x: model.direction == CommHistory.Outbound ? parent.width - width 
: 0
             height: childrenRect.height + 20
-            width: childrenRect.width + 30
+            width: messageText.paintedWidth + 30
             cache: true
             // Fix rotation from the view hack...
             rotation: 180
-
-            property int status: model.status
-
-            Item {
-                id: messageContent
-                height: messageText.paintedHeight
-                width: messageText.paintedWidth
-                y: 10
-                x: 10
-
-                Text {
-                    id: messageText
-                    text: model.freeText
-                    width: messageBox.parent.width * 0.7
-                    wrapMode: Text.Wrap
-                    style: Text.Raised
-                    styleColor: "#eeeeee"
-                    font.family: labelStyle.fontFamily
-                    font.pixelSize: labelStyle.fontPixelSize
-
-                    // Cannot use Label, because it shadows the 'style' 
property.
-                    // Copy its text formatting instead.
-                    LabelStyle {
-                        id: labelStyle
-                    }
-                }
-            }
-
-            function showError(details) {
-                details = "Cannot send message\n\n" + details
-                errorComponent.createObject(messageBox, { text: details })
-            }
-            onStatusChanged: {
-                if (status < 0)
-                    showError(model.statusMessage)
-            }
+            border.left: 24
+            border.right: 24
+            border.top: 24
+            border.bottom: 24
 
             // This should use meegotouch's speechbubble theme elements, but 
those SVG group
             // images are not supported in qt-components currently. 
incoming.svg and outgoing.svg
             // are extracted from the group SVG in meegotouch's base theme and 
included here.
-            states: [
-                State {
-                    name: "incoming"
-                    when: model.direction == CommHistory.Inbound
-
-                    PropertyChanges {
-                        target: messageBox
-                        source: "qrc:/images/incoming.svg"
-                        border.left: 24
-                        border.right: 24
-                        border.top: 24
-                        border.bottom: 24
-                    }
-                },
-                State {
-                    name: "outgoing"
-                    when: model.direction == CommHistory.Outbound
-
-                    PropertyChanges {
-                        target: messageBox
-                        x: parent.width - width
-                        source: "qrc:/images/outgoing.svg"
-                        border.left: 24
-                        border.right: 24
-                        border.top: 24
-                        border.bottom: 24
-                    }
-
-                    PropertyChanges {
-                        target: messageContent
-                        x: 20
-                    }
-                }
-            ]
-
-            Component {
-                id: errorComponent
-
-                Item {
-                    id: errorContent
-                    anchors.top: messageContent.bottom
-                    anchors.topMargin: 5
-                    anchors.left: messageContent.left
-                    width: Math.max(errorText.paintedWidth, 
messageText.paintedWidth)
-                    height: errorText.paintedHeight + 6
-
-                    property alias text: errorText.text
-
-                    Rectangle {
-                        anchors.left: parent.left
-                        anchors.right: parent.right
-                        height: 1
-                        color: "#afafaf"
-                    }
-
-                    Label {
-                        id: errorText
-                        width: messageText.width
-                        anchors.top: parent.top
-                        anchors.topMargin: 5
-
-                        platformStyle: LabelStyle {
-                            textColor: "red"
-                        }
-                    }
-                }
+            source: model.direction == CommHistory.Inbound ? 
"qrc:/images/incoming.svg" : "qrc:/images/outgoing.svg"
+
+            property int status: model.status
+
+            Text {
+                id: messageText
+                x: model.direction == CommHistory.Outbound ? 20 : 10
+                y: 10
+                text: model.freeText
+                width: messageBox.parent.width * 0.7
+                height: paintedHeight
+                wrapMode: Text.Wrap
+                style: Text.Raised
+                styleColor: "#eeeeee"
+                font.family: labelStyle.fontFamily
+                font.pixelSize: labelStyle.fontPixelSize
             }
         }
     }
--- qml/qmlmessages/PageHeader.qml
+++ qml/qmlmessages/PageHeader.qml
@@ -62,7 +62,6 @@
         color: "white"
 
         platformStyle: LabelStyle {
-            fontFamily: "Droid Sans"
             fontPixelSize: 30
         }
     }
--- qml/qmlmessages/main.qml
+++ qml/qmlmessages/main.qml
@@ -43,16 +43,28 @@
 
     Connections {
         target: pageStack
-        onCurrentPageChanged: {
-            var group
-            try {
-                group = pageStack.currentPage.channel
-            } catch (e) {
-            }
-            if (group == undefined)
-                group = null
-            windowManager.currentGroup = group
+        onCurrentPageChanged: updateCurrentGroup()
+    }
+
+    Connections {
+        target: screen
+        onMinimizedChanged: updateCurrentGroup()
+    }
+
+    function updateCurrentGroup() {
+        if (screen.minimized) {
+            windowManager.currentGroup = null;
+            return;
+        }
+
+        var group
+        try {
+            group = pageStack.currentPage.channel
+        } catch (e) {
         }
+        if (group == undefined)
+            group = null
+        windowManager.currentGroup = group
     }
 
     function showConversation(group) {
--- qmlmessages.pro
+++ qmlmessages.pro
@@ -2,7 +2,7 @@
 QT += dbus declarative svg
 
 CONFIG += link_pkgconfig
-PKGCONFIG += commhistory TelepathyQt4
+PKGCONFIG += commhistory TelepathyQt4 contextprovider-1.0
 
 target.path = $$INSTALL_ROOT/usr/bin
 INSTALLS += target
--- src/accountsmodel.cpp
+++ src/accountsmodel.cpp
@@ -33,9 +33,9 @@
 #include <QDBusConnection>
 #include <QDebug>
 
-#include <TelepathyQt4/AccountFactory>
-#include <TelepathyQt4/PendingReady>
-#include <TelepathyQt4/PendingChannelRequest>
+#include <TelepathyQt/AccountFactory>
+#include <TelepathyQt/PendingReady>
+#include <TelepathyQt/PendingChannelRequest>
 
 Q_DECLARE_METATYPE(Tp::AccountPtr)
 
--- src/accountsmodel.h
+++ src/accountsmodel.h
@@ -32,8 +32,8 @@
 #define ACCOUNTSMODEL_H
 
 #include <QAbstractListModel>
-#include <TelepathyQt4/Types>
-#include <TelepathyQt4/AccountManager>
+#include <TelepathyQt/Types>
+#include <TelepathyQt/AccountManager>
 
 class ConversationChannel;
 
--- src/clienthandler.cpp
+++ src/clienthandler.cpp
@@ -32,11 +32,11 @@
 #include "conversationchannel.h"
 #include "groupmanager.h"
 
-#include <TelepathyQt4/ChannelClassSpec>
-#include <TelepathyQt4/ReceivedMessage>
-#include <TelepathyQt4/TextChannel>
-#include <TelepathyQt4/ChannelRequest>
-#include <TelepathyQt4/Account>
+#include <TelepathyQt/ChannelClassSpec>
+#include <TelepathyQt/ReceivedMessage>
+#include <TelepathyQt/TextChannel>
+#include <TelepathyQt/ChannelRequest>
+#include <TelepathyQt/Account>
 
 using namespace Tp;
 
--- src/clienthandler.h
+++ src/clienthandler.h
@@ -32,8 +32,8 @@
 #define CLIENTHANDLER_H
 
 #include <QObject>
-#include <TelepathyQt4/AbstractClientHandler>
-#include <TelepathyQt4/PendingChannelRequest>
+#include <TelepathyQt/AbstractClientHandler>
+#include <TelepathyQt/PendingChannelRequest>
 
 class ConversationChannel;
 
--- src/conversationchannel.cpp
+++ src/conversationchannel.cpp
@@ -32,20 +32,16 @@
 #include "groupmanager.h"
 #include "clienthandler.h"
 
-#include <TelepathyQt4/ChannelRequest>
-#include <TelepathyQt4/TextChannel>
-#include <TelepathyQt4/Channel>
-#include <TelepathyQt4/PendingReady>
-#include <TelepathyQt4/Contact>
-#include <TelepathyQt4/Account>
-#include <TelepathyQt4/AccountManager>
+#include <TelepathyQt/ChannelRequest>
+#include <TelepathyQt/TextChannel>
+#include <TelepathyQt/Channel>
+#include <TelepathyQt/PendingReady>
+#include <TelepathyQt/Contact>
+#include <TelepathyQt/Account>
 
 #include <CommHistory/ConversationModel>
 #include <CommHistory/GroupModel>
 
-// XXX
-extern Tp::AccountManagerPtr accountManager;
-
 ConversationChannel::ConversationChannel(QObject *parent)
     : QObject(parent), mPendingRequest(0), mState(Null), mModel(0), 
mGroupId(-1)
 {
@@ -91,11 +87,30 @@
         return;
 
     // XXX wait for account manager if necessary?
-    Tp::AccountPtr account = accountManager->accountForPath(mLocalUid);
-    // XXX error check
-    Q_ASSERT(account);
-    Q_ASSERT(account->isReady());
-    Tp::PendingChannelRequest *req = account->ensureTextChat(mContactId,
+    mAccount = Tp::Account::create(TP_QT_ACCOUNT_MANAGER_BUS_NAME, mLocalUid);
+    if (!mAccount) {
+        qWarning() << "ConversationChannel::ensureChannel no account for" << 
mLocalUid;
+        setState(Error);
+        return;
+    }
+
+    if (mAccount->isReady()) {
+        accountReadyForChannel(0);
+    } else {
+        connect(mAccount->becomeReady(), 
SIGNAL(finished(Tp::PendingOperation*)),
+                SLOT(accountReadyForChannel(Tp::PendingOperation*)));
+    }
+}
+
+void ConversationChannel::accountReadyForChannel(Tp::PendingOperation *op)
+{
+    if (op && op->isError()) {
+        qWarning() << "No account for" << mLocalUid;
+        setState(Error);
+        return;
+    }
+
+    Tp::PendingChannelRequest *req = mAccount->ensureTextChat(mContactId,
             QDateTime::currentDateTime(),
             QLatin1String("org.freedesktop.Telepathy.Client.qmlmessages"));
     start(req);
--- src/conversationchannel.h
+++ src/conversationchannel.h
@@ -32,11 +32,11 @@
 #define CONVERSATIONCHANNEL_H
 
 #include <QObject>
-#include <TelepathyQt4/PendingChannelRequest>
-#include <TelepathyQt4/ChannelRequest>
-#include <TelepathyQt4/Channel>
-#include <TelepathyQt4/PendingSendMessage>
-#include <TelepathyQt4/ReceivedMessage>
+#include <TelepathyQt/PendingChannelRequest>
+#include <TelepathyQt/ChannelRequest>
+#include <TelepathyQt/Channel>
+#include <TelepathyQt/PendingSendMessage>
+#include <TelepathyQt/ReceivedMessage>
 #include <CommHistory/Group>
 #include <CommHistory/ConversationModel>
 
@@ -94,6 +94,7 @@
     void requestFailed(const QString &errorName, const QString &errorMessage);
 
 private slots:
+    void accountReadyForChannel(Tp::PendingOperation *op);
     void channelRequestCreated(const Tp::ChannelRequestPtr &request);
     void channelRequestSucceeded(const Tp::ChannelPtr &channel);
     void channelRequestFailed(const QString &errorName, const QString 
&errorMessage);
@@ -107,6 +108,7 @@
     Tp::PendingChannelRequest *mPendingRequest;
     Tp::ChannelRequestPtr mRequest;
     Tp::ChannelPtr mChannel;
+    Tp::AccountPtr mAccount;
     State mState;
     CommHistory::ConversationModel *mModel;
 
--- src/main.cpp
+++ src/main.cpp
@@ -38,10 +38,10 @@
 #include <applauncherd/MDeclarativeCache>
 #endif
 
-#include <TelepathyQt4/Constants>
-#include <TelepathyQt4/Debug>
-#include <TelepathyQt4/Types>
-#include <TelepathyQt4/ClientRegistrar>
+#include <TelepathyQt/Constants>
+#include <TelepathyQt/Debug>
+#include <TelepathyQt/Types>
+#include <TelepathyQt/ClientRegistrar>
 
 #include <CommHistory/GroupModel>
 
@@ -52,8 +52,6 @@
 
 using namespace Tp;
 
-Tp::AccountManagerPtr accountManager;
-
 #ifdef HAS_BOOSTER
 Q_DECL_EXPORT
 #endif
@@ -86,9 +84,6 @@
     AbstractClientPtr handler = 
AbstractClientPtr::dynamicCast(SharedPtr<ClientHandler>(clientHandler));
     registrar->registerClient(handler, "qmlmessages");
 
-    accountManager = 
Tp::AccountManager::create(Tp::AccountFactory::create(dbus,
-                         Tp::Account::FeatureCore));
-
     // Set up QML
     qmlRegisterType<AccountsModel>("org.nemomobile.qmlmessages", 1, 0, 
"AccountsModel");
     
qmlRegisterUncreatableType<ConversationChannel>("org.nemomobile.qmlmessages", 
1, 0, "ConversationChannel", "");
--- src/windowmanager.cpp
+++ src/windowmanager.cpp
@@ -37,6 +37,7 @@
 #include <QDeclarativeContext>
 #include <QDeclarativeItem>
 #include <QDBusConnection>
+#include <ContextProvider>
 #ifdef HAS_BOOSTER
 #include <applauncherd/MDeclarativeCache>
 #endif
@@ -58,6 +59,13 @@
     if (!QDBusConnection::sessionBus().registerObject("/", this)) {
         qWarning() << "Cannot register DBus object!";
     }
+
+    ContextProvider::Service *cpService = new 
ContextProvider::Service(QDBusConnection::SessionBus,
+            "org.nemomobile.qmlmessages.context", this);
+    propObservedConversation = new ContextProvider::Property(*cpService, 
"Messaging.ObservedConversation",
+            this);
+    if (propObservedConversation && propObservedConversation->isSet())
+        propObservedConversation->unsetValue();
 }
 
 WindowManager::~WindowManager()
@@ -143,5 +151,12 @@
 
     mCurrentGroup = g;
     emit currentGroupChanged(g);
+
+    if (g) {
+        QVariantList observed;
+        observed << g->localUid() << g->contactId() << 
CommHistory::Group::ChatTypeP2P;
+        propObservedConversation->setValue(observed);
+    } else
+        propObservedConversation->unsetValue();
 }
 
--- src/windowmanager.h
+++ src/windowmanager.h
@@ -37,6 +37,10 @@
 class QDeclarativeView;
 class ConversationChannel;
 
+namespace ContextProvider {
+    class Property;
+}
+
 /* Right now, WindowManager is just responsible for creating/showing the
  * single window we manage when requested via DBus or application launch.
  *
@@ -68,6 +72,7 @@
 private:
     QWeakPointer<QDeclarativeView> mWindow;
     ConversationChannel *mCurrentGroup;
+    ContextProvider::Property *propObservedConversation;
 
     void ensureWindow();
 };

++++++ qmlmessages.yaml
--- qmlmessages.yaml
+++ qmlmessages.yaml
@@ -1,6 +1,6 @@
 Name:  qmlmessages
 Summary: Messaging application for nemo
-Version: 0.0.4
+Version: 0.0.5
 Release: 1
 Group: Applications/System
 License: BSD
@@ -40,6 +40,7 @@
     - qdeclarative-boostable
     - TelepathyQt4
     - commhistory
+    - contextprovider-1.0
 
 Requires:
     - qt-components
@@ -51,3 +52,4 @@
     - "%{_datadir}/telepathy/clients/qmlmessages.client"
     - 
"%{_datadir}/dbus-1/services/org.freedesktop.Telepathy.Client.qmlmessages.service"
     - "%{_datadir}/dbus-1/services/org.nemomobile.qmlmessages.service"
+    - 
"%{_datadir}/contextkit/providers/org.nemomobile.qmlmessages.context.context"



Reply via email to