Pings

When you send someone a message using the normal zwrite command, the first thing that the zwrite does is to send a ``ping'' to the person you are zwriting. This is used to check whether they are logged in. If they are not logged in, Zephyr gives you the message username: Not logged in or not subscribing to messages. To zwrite people without sending pings, you can use the option zwrite -n, which saves a bit of time and lessens the load on the Zephyr servers.

When people use zwrite without the -n to write to you, you can intercept these ``pings'' and have them displayed as small zephyrgrams, so you know who is about to send messages to you. To do this, you will need to modify your .zwgc.desc file, which describes how you want your zephyrgrams to appear on your screen, to tell it to display the pings somewhere on your screen. Then you will know when people are about to zwrite you.

You can check to see if you already have a .zwgc.desc by typing ls -a ~/.zwgc.desc. If you don't, you should first copy the default .zwgc.desc file into your home directory, from the file:

/usr/athena/lib/zephyr/zwgc.desc

You should be sure that you copy it to the file .zwgc.desc, as the default file does not have the initial period. You probably want to have some basic understanding of how the .zwgc.desc file works so that you can figure out where to place modifications you want so that they will have the desired effects. Sample code to receive pings for personal zephyrgrams follows. A few modifications you might want to make might be to change the X_geometry (or leave it out altogether), which determines where to place the zephyrgram on the screen, but also leaves that setting for other zephyrgrams until you change it in your .zwgc.desc file for those cases, and to change the message printed in the ping. You might need to read through your .zwgc.desc file to figure out where the proper location for these lines are; .zwgc.desc hacking is not easy to do by ``formula''. Here is what you would need to include:

match "message"

if (upcase($opcode) == "PING") then

if (upcase($instance) == "PERSONAL" && upcase($class) == "MESSAGE") then

set X_geometry = "+0+20"

print "@b("+$sender+")"

print "@small( is about to send you a message)"

print "@beep()"

put

exit

endif

exit

endif

You may also need to remove a line stating

Geoffrey G Thomas 2009-02-09