[Bug 70434] Idle: add IrcCommand extension

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Oct 14 13:49:25 CEST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=70434

--- Comment #4 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
Comment on attachment 87568
  --> https://bugs.freedesktop.org/attachment.cgi?id=87568
add IrcCommand extension

Review of attachment 87568:
 --> (https://bugs.freedesktop.org/page.cgi?id=splinter.html&bug=70434&attachment=87568)
-----------------------------------------------------------------

::: extensions/Connection_Interface_Irc_Command.xml
@@ +1,2 @@
> +<?xml version="1.0" ?>
> +<node name="/Connection_Interface_Irc_Command" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">

Add to telepathy-spec (when ready), please. I'm trying to reduce the number of
extensions in CMs, and this is no worse than Conn.I.Cellular.

We'd normally use the case combination "IRC_Command" (leading to
TpSvcConnectionInterfaceIRCCommand, connection_interface_irc_command etc.)

I'd be tempted to call it /Connection_Interface_IRC_Command1 from the start, so
the generated code doesn't need a sed application in next.

@@ +23,5 @@
> +    <tp:requires interface="org.freedesktop.Telepathy.Connection"/>
> +    <method name="Send" tp:name-for-bindings="Send">
> +      <arg direction="in" name="Command" type="s">
> +        <tp:docstring>
> +          The command followed by its arguments.

Are IRC commands guaranteed to be representable in UTF-8, or should we be
sending binary? Or should we transcode UTF-8 into the configured server charset
like we do for PRIVMSGs?

I think we need examples, because the conventional client syntax "/badger
snake" does not actually exist in the IRC protocol (although clients that do
not understand /badger would frequently interpret it as "/quote badger snake"
which means "send the literal string 'badger snake' to the server).

For instance, "MODE #telepathy +s" or "PRIVMSG xclaesse :are you there?" might
make good examples.

If the user sends a command that does something Telepathy can already do,
should Idle do things like spawning a channel and emitting MessageSent as a
side-effect? I think the answer should be "yes" but I could be persuaded
otherwise. Other possibilities are "remain silent" and "raise an error".

I think this method call should return an opaque string token, and there should
be a signal CommandResponse(s Token, s Response) or CommandResponse(s Token, ay
Response), depending whether we decide IRC is a text stream or a bytestream.
Alternatively, we could wait for the server response, translate it into
success-or-error and return it, and advise clients to set a longer-than-default
timeout if the command might take a while.

@@ +34,5 @@
> +        <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
> +        <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/>
> +        <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable"/>
> +        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/>
> +        <tp:error name="org.freedesktop.Telepathy.Error.PermissionDenied"/>

When would you get these errors? Disconnected and NetworkError I can see, but
how do the rest work? Are we expecting the CM to interpret the response?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the telepathy-bugs mailing list