Bug 43025 - Add setStatusMessage(QString) to Tp::Presence
Summary: Add setStatusMessage(QString) to Tp::Presence
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-qt (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Martin Klapetek
QA Contact: Telepathy bugs list
Keywords: patch
Depends on:
Reported: 2011-11-17 07:07 UTC by Martin Klapetek
Modified: 2011-12-30 10:41 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

Patch (998 bytes, patch)
2011-12-30 04:22 UTC, Martin Klapetek
Details | Splinter Review

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]

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.