Bug 307577 - Facebook contacts can't be preselected
Summary: Facebook contacts can't be preselected
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: log-viewer (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: 0.5-next
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-29 15:33 UTC by Daniel Vrátil
Modified: 2012-09-30 18:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.5.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Vrátil 2012-09-29 15:33:39 UTC
Facebook contacts can't be preselected in logviewer, because their UID (or at least of some of them) starts with "-", so the command to invoke ktp-log-viewer with such contact preselected looks like
ktp-log-viewer gabble/jabber/some.user_40chat_2efacebook_2ecom0/ -0123456789@chat.facebook.com

This obviously does not work because KCmdLineArgs interprets the contact UID as a switch and fails with "Unknown option '0123456789@chat.facebook.com'."





Reproducible: Always

Steps to Reproduce:
1. chat with some Facebook contact
2. click "Previous Converstions" in textui

Actual Results:  
Nothing happens

Expected Results:  
Logviewer is opened and the contact is correctly preselected

I suggest changing the ktp-log-viewer command line syntax to

ktp-logviewer accountID,contactID

e.g. passing accountID and contactID as a single argument and separate them just by comma for easier parsing. This assumes comma is not an allowed character within accountID and contactID, which I believe is a safe assumption.
Comment 1 David Edmundson 2012-09-29 15:38:18 UTC
Would simply using quotes when loading log viewer fix it?

could you run this from a console and see if it works?

ktp-log-viewer "gabble/jabber/some.user_40chat_2efacebook_2ecom0/" "-0123456789@chat.facebook.com"

The reason I ask is that we shouldn't really be changing the args to a program in a minor release, and this looks like something that would be good to fix in the 0.5.x series.
Comment 2 Daniel Vrátil 2012-09-29 15:55:01 UTC
Hmm, maybe I was too harsh with the review request then :) Anyway nope, it does not work.
Comment 3 George Kiagiadakis 2012-09-30 09:47:32 UTC
It should work with double dashes before the arguments. i.e.:

ktp-log-viewer -- gabble/jabber/some.user_40chat_2efacebook_2ecom0/ -0123456789@chat.facebook.com
Comment 4 Daniel Vrátil 2012-09-30 17:19:51 UTC
That does not work either, because the values are not available in KCmdLineArgs::parserArgs()
Comment 5 Daniel Vrátil 2012-09-30 17:23:20 UTC
Ignore my previous comment, it actually works! I made a typo in the UID before.

I'll fix all the components that invoke logviewer to pass "--" as the first argument.
Comment 6 Daniel Vrátil 2012-09-30 18:28:09 UTC
Git commit 278f9f82550cf763e96585ec5aed6418f9cc760e by Dan Vrátil.
Committed on 30/09/2012 at 19:46.
Pushed by dvratil into branch 'kde-telepathy-0.5'.

Fix invoking logviewer with preselected Facebook contact
REVIEW: 106635

M  +4    -2    app/chat-window.cpp

http://commits.kde.org/telepathy-text-ui/278f9f82550cf763e96585ec5aed6418f9cc760e