Bug 43025

Summary: Add setStatusMessage(QString) to Tp::Presence
Product: Telepathy Reporter: Martin Klapetek <martin.klapetek>
Component: tp-qtAssignee: Martin Klapetek <martin.klapetek>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: enhancement    
Priority: medium CC: ollisal
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch

Description Martin Klapetek 2011-11-17 07:07:49 UTC
Tp::Presence already enables one to set all fields of Presence with 

Tp::Presence::setStatus(ConnectionPresenceType type, QString status, QString statusMessage)

and also with

Tp::Presence::setStatus(SimplePresence presence).

Currently when you want to set just a presenceMessage and leave the current presence type for one of your accounts, you have to use 

currentPresence.setStatus(currentPresence.type(), currentPresence.status(), presenceMessage).

So this patch adds a simple setter for presenceMessage - setPresenceMessage(QString).
Comment 1 Olli Salli 2011-12-29 08:04:36 UTC
Umm, where is the patch? :P
Comment 2 Martin Klapetek 2011-12-30 04:22:52 UTC
Created attachment 54972 [details] [review]
Patch

Oops, how did I miss uploading it??
Comment 3 Olli Salli 2011-12-30 10:41:48 UTC
The patch is fine. I was about to comment about missing documentation... but there is no documentation for anything in Tp::Presence.

So, now we have:

setStatus(type, status, message) // sets all
setStatusMessage(message) // keeps the current status

I think this is exactly what we should have. The type and status can't be sensibly set separately, because they are tied together. Also, whether a message can be set depends on the status in many protocols, so if you change the status, the message can't necessarily stay the same.

I've added a TODO note to explain this when the class in general is documented properly... and merged your patch to master. Will be in tp-qt-0.9.1.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.