Patches item #1672389, was opened at 2007-03-02 07:12
Message generated for change (Comment added) made by rlaager
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1672389&group_id=235

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: newfeature
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: filippo_a (filippo_a)
Assigned to: Nobody/Anonymous (nobody)
Summary: Attention request signals..

Initial Comment:
Hi i was trying to write, just for fun, a plugin that shakes the window when a 
nudge arrives but the only way i've found to do it was listening to 
displayed-im-msg signal. Since i don't think that's the better way i've added 
two conversation signals that are emitted when msn receives and sends a nudge. 
They can also be emitted by yahoo buzz or whenever an "attention request" event 
is needed. The received-attention-request signal takes also a string as an 
argument to contain the buddy name who requested our attention.
Please let me know if am i doing something wrong or if it isn't the right way 
to do it.
I've also writed a small plugin to test the signals and make window shake on 
nudge.. let me know if you want to test it.
Thanks
Filippo


----------------------------------------------------------------------

>Comment By: Richard Laager (rlaager)
Date: 2007-03-12 17:55

Message:
Logged In: YES 
user_id=156487
Originator: NO

Sadrul is right here. Can you take a look at implementing it that way? It
should be pretty easy. IM me if you get stuck.

----------------------------------------------------------------------

Comment By: filippo_a (filippo_a)
Date: 2007-03-04 02:50

Message:
Logged In: YES 
user_id=1733309
Originator: YES

rlaager, i don't like serv_send_im because it hasn't a god error checking
and signal emitting like conv_im_send and common_send..
I think sadrul way is better than mine (and rlaagers'). If we add an
attention flag each protocol could print whatever it wants to notice the
attention request (like "Buzz" for yahoo, or "you received a Nudge" for
msn) just tagging it with the flag. I could implement the new way as soon
as i have some spare time. Let me know if i have to do it or if someone
else will do.
We still have to decide what to do with yahoo printing a blank line
thing.. I think a new INVISIBLE flag would be the best thing.
Another thing: prpl->send_bell would be no more needed with new solution
or do you see a way it could be useful?
bye, Filippo


----------------------------------------------------------------------

Comment By: Sadrul Habib Chowdhury (sadrul)
Date: 2007-03-03 18:48

Message:
Logged In: YES 
user_id=1132702
Originator: NO

In the patch, I dislike the way yahoo emits sending- and sent- signals.
This is a byproduct of using serv_send_im, since that doesn't emit the
signals.

The GTK+ UI can trigger the sound from the callback of
received-chat/im-msg if REQUEST_ATTENTION is set. (currently it does so for
chats only). And we may want to rename GAIM_SOUND_CHAT_NICK to
GAIM_SOUND_ATTENTION too.

The plugin could listen to received-im-msg and trigger the window-shake
craziness ( ;) ) if flags & REQUEST_ATTENTION.

If plugins want to do stuff when *sending* a bell, then it could probably
listen to sending-im-msg, and look for (_SEND | _REQUEST_ATTENTION), since
both will be set in such a case.

I haven't thought too deep about send_bell. Having a send_bell might make
things a little easier, but if I am thinking correctly, then either:
(1) the core detects that a bell-message is being sent, and triggers
prplinfo->send_bell, or
(2) a prpl detects that a bell-message is being sent, and triggers
prplinfo->send_bell.

For case (1), there needs to be a common way of marking a message as a
bell_message across all prpls. This is not the case right now (eg. /buzz
for yahoo, /nudge for msn etc.). For case (2), if prplinfo->send_bell is
being called only from within the prpl, then it's not necessary to have it
in prplinfo anyway.

Am I making sense any more? O:-)

----------------------------------------------------------------------

Comment By: Richard Laager (rlaager)
Date: 2007-03-03 17:45

Message:
Logged In: YES 
user_id=156487
Originator: NO

Why do you think that serv_send_im() is a bad way to do it?

Sadrul: I can't think of a good reason you're wrong, so you must be right!
So basically we'd have the GTK+ UI play the alert.wav if (flags &
REQUEST_ATTENTION && conv->type == CHAT)? Then the plugin here could shake
the window if (flags... && conv->type != CHAT)?

That seems reasonable. How would you want to deal with sending an
attention request? It seems like that should still be a send_bell (or
send_attention_request) prpl function, right?

----------------------------------------------------------------------

Comment By: filippo_a (filippo_a)
Date: 2007-03-03 14:05

Message:
Logged In: YES 
user_id=1733309
Originator: YES

i wanted to say "instead of using system flag.."
i'm sorry

----------------------------------------------------------------------

Comment By: filippo_a (filippo_a)
Date: 2007-03-03 13:32

Message:
Logged In: YES 
user_id=1733309
Originator: YES

i don't think sadrul way is opposed to mine.. maybe instead of using
message flag we could use his new flag.. and if not where is supposed to be
emitted the attention request signal? from the ui or from the core?

----------------------------------------------------------------------

Comment By: Richard Laager (rlaager)
Date: 2007-03-03 10:33

Message:
Logged In: YES 
user_id=156487
Originator: NO

Sadrul, you make an interesting argument. I'm going to have to do some
more thinking to come up with a good reply.

----------------------------------------------------------------------

Comment By: filippo_a (filippo_a)
Date: 2007-03-03 04:44

Message:
Logged In: YES 
user_id=1733309
Originator: YES

..and this is my sample plugin to make window shake like on official
clients
Instructions:
- copy shake.c to gtk/plugins/ dir on patched source code
- make shake.so
- copy shake.so to ~/.gaim/plugins
- the plugin looks for a nudge.wav on ~/.gaim/plugins so if you want it
copy a test sound there..
File Added: shake.c

----------------------------------------------------------------------

Comment By: filippo_a (filippo_a)
Date: 2007-03-03 04:37

Message:
Logged In: YES 
user_id=1733309
Originator: YES

I'm sorry, i forgot to attach the new patch :P
File Added: gaim-bell-2.diff

----------------------------------------------------------------------

Comment By: filippo_a (filippo_a)
Date: 2007-03-03 04:36

Message:
Logged In: YES 
user_id=1733309
Originator: YES

Hey, here's a new patch coming to better fit rlaager requests:
- changed variable passed to signal handler from username to who
- changed system messages' text
- added yahoo buzz support. Here i've experienced a little problem:
Yahoo seems to implement buzz just sending "<ding>" string to
conversation. Since using gaim_conv_im_send to send this string caused a
blank line to be printed before my system message i replaced it with
serv_send_im.. I don't think this is the best solution.. Maybe a new
GAIM_MESSAGE_INVISIBLE flag to tag a message to be just sent to server and
not to be printed would do the work?

Filippo

----------------------------------------------------------------------

Comment By: Sadrul Habib Chowdhury (sadrul)
Date: 2007-03-03 03:56

Message:
Logged In: YES 
user_id=1132702
Originator: NO

I didn't follow the idea of bells in the core. Looking at how Yahoo deals
with buzzes now (setting the GAIM_MESSAGE_NICK flag), I would've thought
the same could be done for nudges. Apart from this use, the flag is
currently used only when someone says your nick in a chat. I think we could
rename the flag to GAIM_MESSAGE_REQUEST_ATTENTION or some such, set it for
chats as it is now, and for ims for buzz/nudge etcs, and deal with it from
the UI if/as it wants to.

----------------------------------------------------------------------

Comment By: Richard Laager (rlaager)
Date: 2007-03-02 21:09

Message:
Logged In: YES 
user_id=156487
Originator: NO

At a quick look, I like this. Here are some things to look at:

1. I don't think you should be passing the username variable to the signal
handler. This means the plugin could get an alias, which is suboptimal.
Pass it the who variable instead.

2. "sent an attention request to %s!"... how about something more
symetrical with the incoming message, like "You have requested %s's
attention." or "You have requested the attention of %s."? I personally like
the possessive, but given the crazy MSN "friendly names" that people use,
the latter approach might be best.

If you finish this off with Yahoo support, I think we can get this in,
either for 2.0.0 or 2.1.0.

----------------------------------------------------------------------

Comment By: filippo_a (filippo_a)
Date: 2007-03-02 15:38

Message:
Logged In: YES 
user_id=1733309
Originator: YES

Hey, I've written another patch to better follow what rlaager said and
what i've discussed with etan on irc..
I've added gaim_conv_bell_send and _receive functions to the core, and a
new prpl_info function pointer send_bell.
gaim_conv_bell_receive simply prints a system message and emits a bell
receive signal that can be catched on plugins.
gaim_conv_bell_send just prints a system message.
prpl->send_bell is intended for future use for example bell sending button
or something else.
I've just changed the msn protocol only, still have to make yahoo use my
core api. I don't know if other protocols support sending attention
requests.
I've moved part of msn_cmd_nudge to msn_send_bell leaving the command
function just to manage command return value.
As i recall that's all. Please let me know if it is the right way to fit
your requests!
Thanks
Filippo

PS.
as i said before i've written also a sample plugin to make the window
shake (please don't hate me for this :P) if you want to try it let me know!
File Added: gaim-bell.diff

----------------------------------------------------------------------

Comment By: filippo_a (filippo_a)
Date: 2007-03-02 10:00

Message:
Logged In: YES 
user_id=1733309
Originator: YES

i didnt't catch you on im..
i don't know if i understood what you mean.. you want me to write the
common function to replace msn_nudge and the equivalent of yahoo with a
cross-protocol one? and emit my signal from there? i'm new to gaim
development what do you mean when you say core? libgaim? isn't
conversation.c the right place to register my signals?


----------------------------------------------------------------------

Comment By: Richard Laager (rlaager)
Date: 2007-03-02 08:32

Message:
Logged In: YES 
user_id=156487
Originator: NO

The plan we've had for this is to add a concept of a "bell" (or similar)
to the core. The protocols would call some common function to deal with the
receipt of a nudge or buzz, and the core would sent the signal and print
the message to the conversation window. If you're going to start adding
signals for this, I'd like to see the core functionality taken care of at
the same time.

If you want to talk about this more, feel free to catch me online. Given
that you've written patches for them, the following protocols will probably
work best for you: Yahoo: rlaager or MSN: [EMAIL PROTECTED]

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1672389&group_id=235

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Gaim-patches mailing list
Gaim-patches@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gaim-patches

Reply via email to