"Office Hours" plugin for pidgin/purple - published & linked.

View: New views
7 Messages — Rating Filter:   Alert me  

Parent Message unknown "Office Hours" plugin for pidgin/purple - published & linked.

by Kyrian :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

No response so far to the previous posting, oh well :-(
> So, I saw the need to write a plugin for Pidgin that you can enable to
> automatically log you out of your accounts if you are listed as 'Away'
> and it's outside your configured 'Office Hours'.
>
>    
...

Another problem I have hit upon is that I am not quite sure how to
inject comments saying 'automatically logged out by office hours plugin'
into an open conversation/window, or make a pop-up saying that all
active accounts have been logged out, which is necessary to fulfil the
'principal of least astonishment' of the plugin's operation.

I think I've found enough docs to work it out via trial and error, but
any hints would be appreciated.

Otherwise, it seems to work a treat, including its secondary goal of
retaining open windows (so as not to lose conversation content without
having to use the logging plugin), as Pidgin does not close windows
automatically when you're logged out of an account with the Perl API,
which I realise is an undocumented 'feature', and this plugin will rely
on it continuing to be the case, or there to be some option to allow for
it in future.
> http://developer.pidgin.im/wiki/ThirdPartyPlugins#DevelopmentofThird-PartyPlugins
>    
I have now linked it to the above page, where it looked like it fit
("Accounts and logs" section). I just created a simple Apache directory
index type page with a header, it's not pretty but it will do for now:

http://www.orenet.co.uk/opensource/pidgin-oo/

K.

--
Kev Green, aka Kyrian. E: kyrian@ore.org WWW: http://kyrian.ore.org/
Linux/Security Contractor/LAMP Coder/ISP, via http://www.orenet.co.uk/
                  DJ via http://www.hellnoise.co.uk/

Human Rights left unattended may be Removed, or Destroyed, or Damaged
                      by the Security Services.

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Re: "Office Hours" plugin for pidgin/purple - published & linked.

by Phil Hannent-4 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kyrian wrote:
> http://www.orenet.co.uk/opensource/pidgin-oo/
I cannot download the perl file due to access denied.  It says:

You don't have permission to access the requested object.
It is either read-protected or not readable by the server.

Regards
Phil Hannent
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrIqc8ACgkQIdVDbqU9AORVZgCfdNz4bXmmI2JFf75fxZdjNrjt
Sv4AoNK2dhNArIAT2kkNsK2uQm+On+Yp
=yQHX
-----END PGP SIGNATURE-----

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Re: "Office Hours" plugin for pidgin/purple - published & linked.

by Kyrian :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message


>> http://www.orenet.co.uk/opensource/pidgin-oo/
>>      
> I cannot download the perl file due to access denied.  It says:
>
> You don't have permission to access the requested object.
> It is either read-protected or not readable by the server.
>    
Doh. Unfortunately it was not permissions, I'd have noticed that. The
MIME type configuration was broken worse than I thought. Apache was
barfing because it was a CGI-like file extension in a non-CGI directory
among other things.

It is now fixed, and I have credited you with pointing it out, sorry
about that.

It was the middle of the night and after beer, that's my excuse and I'm
sticking to it ;-)

K.

--
Kev Green, aka Kyrian. E: kyrian@ore.org WWW: http://kyrian.ore.org/
Linux/Security Contractor/LAMP Coder/ISP, via http://www.orenet.co.uk/
                  DJ via http://www.hellnoise.co.uk/

Human Rights left unattended may be Removed, or Destroyed, or Damaged
                      by the Security Services.

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Re: "Office Hours" plugin for pidgin/purple - published & linked.

by Phil Hannent-4 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kyrian wrote:

>
>>> http://www.orenet.co.uk/opensource/pidgin-oo/
>>>      
>> I cannot download the perl file due to access denied.  It says:
>>
>> You don't have permission to access the requested object.
>> It is either read-protected or not readable by the server.
>>    
> Doh. Unfortunately it was not permissions, I'd have noticed that. The
> MIME type configuration was broken worse than I thought. Apache was
> barfing because it was a CGI-like file extension in a non-CGI directory
> among other things.
>
> It is now fixed, and I have credited you with pointing it out, sorry
> about that.
>
> It was the middle of the night and after beer, that's my excuse and I'm
> sticking to it ;-)
Thanks for fixing it.  It works on my ubuntu 9.04 machine just fine.
I'll be trying windows tomorrow as thats what I really need it for.

Regards
Phil Hannent

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrI1h8ACgkQIdVDbqU9AOTL5QCg0d1eLhuWoHsWmI8qxX1ZjCIm
0jIAoIiS4/tIL56V/0wlsiax/kMYrUxd
=lza0
-----END PGP SIGNATURE-----

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Re: "Office Hours" plugin for pidgin/purple - published & linked.

by Etan Reisner-2 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

On Sat, Oct 03, 2009 at 07:51:39PM +0100, Kyrian wrote:
<snip>
> Another problem I have hit upon is that I am not quite sure how to inject
> comments saying 'automatically logged out by office hours plugin' into an
> open conversation/window, or make a pop-up saying that all active accounts
> have been logged out, which is necessary to fulfil the 'principal of least
> astonishment' of the plugin's operation.
>
> I think I've found enough docs to work it out via trial and error, but any
> hints would be appreciated.

The only way to print such a message into each conversation window would
be to fetch the list of conversation windows and walk through it printing
it to each window (before disconnecting if you want to send it to the
remote party, which I would strongly recommend not doing).

I'm not sure, however, that printing such a message is actually a good
idea though. I think it likely to be better to simply create an Offline
status with a message of "After Office Hours" or something similar and
then just activating that status when the plugin fires.

> Otherwise, it seems to work a treat, including its secondary goal of
> retaining open windows (so as not to lose conversation content without
> having to use the logging plugin), as Pidgin does not close windows
> automatically when you're logged out of an account with the Perl API, which
> I realise is an undocumented 'feature', and this plugin will rely on it
> continuing to be the case, or there to be some option to allow for it in
> future.

This isn't documented because it isn't a "feature" as much as it is the
only idea that really makes any sense as the presence of a conversation
window has no relationship to whether the account is online or not.

Consider someone who had a particularly poor network connection, if pidgin
were to close a conversation window whenever an account were to get
disconnected such a person would never be able to hold a useful
conversation as there window would constantly be closing on them
(potentially even while they were typing a message).

> K.

A couple general style/etc. comments.

Callbacks added with timeout_add will repeat if you return TRUE from the
callback function, to stop them return false. I'm not sure what perl
functions return by default but you might be adding a new callback each
time your callback fires at the moment (which should all get cleaned up
correctly at unload time as the perl loader handles that for you).

As I indicated above using a custom Offline status is likely a better idea
that manually disconnecting each account (though it does require using the
Status and SavedStatus APIs which are slightly more complicated).

Correct, you need to add all necessary parent preferences before adding
the final preferences. I'll probably add some debugging messages to make
this clearer in the future (they will indicate that adding the pref failed
because the parent could not be found).

Re-using $ppref is perfectly fine the way you are using it.

In order to modify the type of an existing preference you need to remove
and re-add it.

    -Etan

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Re: "Office Hours" plugin for pidgin/purple - published & linked.

by Kyrian :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Etan,

Thanks for all this info, much obliged.

In general, assuming I read it right, you are recommending an approach
of disconnecting as I currently do, but setting the user's status within
Pidgin (but not in the now-disconnected protocols) to be eg. 'Offline
Office Hours' instead of 'Away' or 'Available' using the "Status" and
"SavedStatus APIs", as a means of indicating what has happened, rather
than producing a pop-up message, or appending into each conversation
that it's happened. I like the idea, as it's not intrusive, even if the
implementation is more complicated. However I also like the idea of a
pop-up dialogue that says 'Reconnect' or 'Ignore' when this has
happened, although I'm not sure there is a justification for it if
changing your status back to 'Available' will accomplish a re-connection.

I also take your comments in regards not closing windows when the
protocol account is disconnected to mean 'yes, it will continue to
behave that way, even though it is not a documented "feature"'.

In the context of this plugin, I am a little concerned about what would
happen with accounts that the user has configured but disabled, and in
other esoteric states, but this may turn out not to be a problem to
begin with, after all a disconnected account won't show the 'Offline
Office Hours' status to remote users anyway. Obviously I'm not using any
connect/disconnect methods that affect all accounts, as that would just
be asking for trouble, conversely I would hate to think of the plugin
being used by burglars to determine when someone's office is empty ;-)

That being said, there's a lot to digest and test in your email, so I'll
come back if there are any further queries.

K.

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Re: "Office Hours" plugin for pidgin/purple - published & linked.

by Etan Reisner-2 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

On Mon, Oct 19, 2009 at 10:06:22AM +0100, Kyrian wrote:

> Etan,
>
> Thanks for all this info, much obliged.
>
> In general, assuming I read it right, you are recommending an approach of
> disconnecting as I currently do, but setting the user's status within
> Pidgin (but not in the now-disconnected protocols) to be eg. 'Offline
> Office Hours' instead of 'Away' or 'Available' using the "Status" and
> "SavedStatus APIs", as a means of indicating what has happened, rather than
> producing a pop-up message, or appending into each conversation that it's
> happened.

I'm suggesting that you can (and should) avoid manually setting any
accounts statuses and instead use the Status APIs to set a global Offline
status with your custom message and let that disconnect the accounts.

This will cause the status selector to change, any
notifications/logging/etc. that the user may have set up for local status
changes to trigger and play nicely with coming back (as you indicate
below, simply selecting Available or whatever other status the user might
want to reconnect).

You can even go so far as to let users select a Saved Status to switch to
in the 'Office Hours' mode (thus letting them only sign out of some
accounts and not all accounts for example).

> I like the idea, as it's not intrusive, even if the
> implementation is more complicated. However I also like the idea of a
> pop-up dialogue that says 'Reconnect' or 'Ignore' when this has happened,
> although I'm not sure there is a justification for it if changing your
> status back to 'Available' will accomplish a re-connection.

Yeah, I think given that a simple normal status selection will reconnect
the appropriate accounts I'm uncertain that you need a pop-up dialog for
this, though you are always free to have one for people who want it (we
still occasionally get requests for the old "I'm Away!" dialog that hasn't
existed in ages because some people like the external notification).

> I also take your comments in regards not closing windows when the protocol
> account is disconnected to mean 'yes, it will continue to behave that way,
> even though it is not a documented "feature"'.

Indeed, I cannot forsee any reason that we would forcibly close
conversation windows simply because the connection goes away (I can
imagine specific protocols doing this on their own if the conversations
cannot meaningfully be resumed after a reconnect, but that wouldn't be a
pidgin or libpurple thing).

> In the context of this plugin, I am a little concerned about what would
> happen with accounts that the user has configured but disabled, and in
> other esoteric states, but this may turn out not to be a problem to begin
> with, after all a disconnected account won't show the 'Offline Office
> Hours' status to remote users anyway. Obviously I'm not using any
> connect/disconnect methods that affect all accounts, as that would just be
> asking for trouble, conversely I would hate to think of the plugin being
> used by burglars to determine when someone's office is empty ;-)

Any account that is not Enabled will never be affected by status changes,
that's what disabled means.

I would argue that any per-account disconnection methods are actually
worse than all Enabled account status change methods as inconsistent
states are much harder to remember and deal with than consistent ones
(even when those consistent ones are complex, with accounts in different
statuses with different messages). This, by the way, is one of the
benefits of allowing the user to select a status to switch to as I
mentioned above (the way we let users switch the auto-away status, for
example).

> That being said, there's a lot to digest and test in your email, so I'll
> come back if there are any further queries.
>
> K.

Glad I could help.

    -Etan

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel