Fri, 21 May 2004 14:33:32 +0000
[gaim-migrate @ 9774]
" This patch renames the existing received-*-msg signals
to receiving-*msg to fit the naming of other signals
where a pointer to the message is passed (writing,
sending, displaying)
It adds new received-*-msg signals which are emitted
after the receiving signals, in line with the other
conversation signals (wrote, sent, displayed)
This is necessary to allow plugins which depend on the
final received message to work alongside plugins which
may modify the message.
One known example of this is festival-gaim alongside
gaim-encryption - festival-gaim would try to "speak"
the encrypted text:
http://sf.net/tracker/?func=detail&aid=943216&group_id=89763&atid=591320
I've tested this with gaim-encryption and festival-gaim
(locally modified so gaim-encryption uses the receiving
signal and festival uses the received signal)
All in-tree users of received-*-msg are updated to use
receiving-*-msg if they do modify the message, the
conversation-signals documentation is updated, the
signals-test.c & signal-test.tcl plugins are also updated." --Stu Tomlinson
committer: Luke Schierer <lschiere@pidgin.im>
| 2086 | 1 | /* This file is part of the Project Athena Zephyr Notification System. |
| 2 | * It contains source for the ZGetSender.c function. | |
| 3 | * | |
| 4 | * Created by: Robert French | |
| 5 | * | |
| 6 | * $Source$ | |
|
8792
b0645c9dc276
[gaim-migrate @ 9554]
Christian Hammond <chipx86@chipx86.com>
parents:
2086
diff
changeset
|
7 | * $Author: chipx86 $ |
| 2086 | 8 | * |
| 9 | * Copyright (c) 1987, 1991 by the Massachusetts Institute of Technology. | |
| 10 | * For copying and distribution information, see the file | |
| 11 | * "mit-copyright.h". | |
| 12 | */ | |
| 13 | /* $Header$ */ | |
| 14 | ||
|
8792
b0645c9dc276
[gaim-migrate @ 9554]
Christian Hammond <chipx86@chipx86.com>
parents:
2086
diff
changeset
|
15 | #include "internal.h" |
| 2086 | 16 | |
| 17 | #ifndef lint | |
| 18 | static const char rcsid_ZGetSender_c[] = | |
|
8792
b0645c9dc276
[gaim-migrate @ 9554]
Christian Hammond <chipx86@chipx86.com>
parents:
2086
diff
changeset
|
19 | "$Id: ZGetSender.c 9554 2004-04-24 09:02:28Z chipx86 $"; |
| 2086 | 20 | #endif |
| 21 | ||
| 22 | #include <pwd.h> | |
| 23 | ||
| 24 | char *ZGetSender() | |
| 25 | { | |
| 26 | struct passwd *pw; | |
| 27 | #ifdef ZEPHYR_USES_KERBEROS | |
| 28 | char pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ]; | |
| 29 | static char sender[ANAME_SZ+INST_SZ+REALM_SZ+3] = ""; | |
| 30 | #else | |
| 31 | static char sender[128] = ""; | |
| 32 | #endif | |
| 33 | ||
| 34 | /* Return it if already cached */ | |
| 35 | if (*sender) | |
| 36 | return (sender); | |
| 37 | ||
| 38 | #ifdef ZEPHYR_USES_KERBEROS | |
| 39 | if (krb_get_tf_fullname((char *)TKT_FILE, pname, pinst, prealm) == KSUCCESS) | |
| 40 | { | |
| 41 | (void) sprintf(sender, "%s%s%s@%s", pname, (pinst[0]?".":""), | |
| 42 | pinst, prealm); | |
| 43 | return (sender); | |
| 44 | } | |
| 45 | #endif | |
| 46 | ||
| 47 | /* XXX a uid_t is a u_short (now), but getpwuid | |
| 48 | * wants an int. AARGH! */ | |
| 49 | pw = getpwuid((int) getuid()); | |
| 50 | if (!pw) | |
| 51 | return ("unknown"); | |
| 52 | (void) sprintf(sender, "%s@%s", pw->pw_name, __Zephyr_realm); | |
| 53 | return (sender); | |
| 54 | } |