annotate plugins/zephyr/ZLocations.c @ 1993:a4db3667da12

[gaim-migrate @ 2003] i don't know if this is good or bad committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 11 Jun 2001 21:11:48 +0000
parents 1e0fa7e130d0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1700
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 /* This file is part of the Project Athena Zephyr Notification System.
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 * It contains source for the ZSetLocation, ZUnsetLocation, and
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 * ZFlushMyLocations functions.
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 *
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 * Created by: Robert French
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 *
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 * $Source$
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 * $Author: warmenhoven $
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 *
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 * For copying and distribution information, see the file
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 * "mit-copyright.h".
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 */
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 /* $Header$ */
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 #ifndef lint
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 static char rcsid_ZLocations_c[] =
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18 "$Zephyr: /afs/athena.mit.edu/astaff/project/zephyr/src/lib/RCS/ZLocations.c,v 1.30 90/12/20 03:04:39 raeburn Exp $";
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 #endif
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 #include <internal.h>
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 #include <pwd.h>
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 extern char *getenv();
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 extern int errno;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 Code_t ZSetLocation(exposure)
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 char *exposure;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 return (Z_SendLocation(LOGIN_CLASS, exposure, ZAUTH,
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 "$sender logged in to $1 on $3 at $2"));
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 Code_t ZUnsetLocation()
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36 {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_LOGOUT, ZNOAUTH,
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 "$sender logged out of $1 on $3 at $2"));
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 Code_t ZFlushMyLocations()
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_FLUSH, ZAUTH, ""));
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 static char host[MAXHOSTNAMELEN], mytty[MAXPATHLEN];
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 static int reenter = 0;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 Code_t Z_SendLocation(class, opcode, auth, format)
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 char *class;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 char *opcode;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 Z_AuthProc auth;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53 char *format;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54 {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 int retval;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 time_t ourtime;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 ZNotice_t notice, retnotice;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58 char *bptr[3];
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 #ifndef X_DISPLAY_MISSING
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 char *display;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61 #endif
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 char *ttyp;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 struct hostent *hent;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 short wg_port = ZGetWGPort();
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 (void) memset((char *)&notice, 0, sizeof(notice));
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 notice.z_kind = ACKED;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68 notice.z_port = (u_short) ((wg_port == -1) ? 0 : wg_port);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 notice.z_class = class;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 notice.z_class_inst = ZGetSender();
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 notice.z_opcode = opcode;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72 notice.z_sender = 0;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73 notice.z_recipient = "";
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 notice.z_num_other_fields = 0;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 notice.z_default_format = format;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 /*
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 keep track of what we said before so that we can be consistent
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79 when changing location information.
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 This is done mainly for the sake of the WindowGram client.
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81 */
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83 if (!reenter) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84 if (gethostname(host, MAXHOSTNAMELEN) < 0)
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 return (errno);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87 hent = gethostbyname(host);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
88 if (hent) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89 (void) strncpy(host, hent->h_name, sizeof(host));
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
90 host[sizeof(host) - 1] = '\0';
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92 bptr[0] = host;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93 #ifndef X_DISPLAY_MISSING
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94 if ((display = getenv("DISPLAY")) && *display) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
95 (void) strcpy(mytty, display);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
96 bptr[2] = mytty;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
97 } else {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98 #endif
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99 ttyp = ttyname(0);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
100 if (ttyp) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101 bptr[2] = strrchr(ttyp, '/');
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102 if (bptr[2])
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
103 bptr[2]++;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
104 else
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
105 bptr[2] = ttyp;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
106 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
107 else
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 bptr[2] = "unknown";
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109 (void) strcpy(mytty, bptr[2]);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
110 #ifndef X_DISPLAY_MISSING
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
111 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
112 #endif
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
113 reenter = 1;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114 } else {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115 bptr[0] = host;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
116 bptr[2] = mytty;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
117 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
118
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
119 ourtime = time((time_t *)0);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 bptr[1] = ctime(&ourtime);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121 bptr[1][strlen(bptr[1])-1] = '\0';
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
123
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
124 if ((retval = ZSendList(&notice, bptr, 3, auth)) != ZERR_NONE)
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
125 return (retval);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
126
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
127 retval = Z_WaitForNotice (&retnotice, ZCompareUIDPred, &notice.z_uid,
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
128 SRV_TIMEOUT);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
129 if (retval != ZERR_NONE)
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
130 return retval;
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
131
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
132 if (retnotice.z_kind == SERVNAK) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
133 if (!retnotice.z_message_len) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
134 ZFreeNotice(&retnotice);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135 return (ZERR_SERVNAK);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
136 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137 if (!strcmp(retnotice.z_message, ZSRVACK_NOTSENT)) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138 ZFreeNotice(&retnotice);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
139 return (ZERR_AUTHFAIL);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
140 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
141 if (!strcmp(retnotice.z_message, ZSRVACK_FAIL)) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
142 ZFreeNotice(&retnotice);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
143 return (ZERR_LOGINFAIL);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
145 ZFreeNotice(&retnotice);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
146 return (ZERR_SERVNAK);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
148
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
149 if (retnotice.z_kind != SERVACK) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
150 ZFreeNotice(&retnotice);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
151 return (ZERR_INTERNAL);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
152 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
153
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
154 if (!retnotice.z_message_len) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155 ZFreeNotice(&retnotice);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
156 return (ZERR_INTERNAL);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
157 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
158
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
159 if (strcmp(retnotice.z_message, ZSRVACK_SENT) &&
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
160 strcmp(retnotice.z_message, ZSRVACK_NOTSENT)) {
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
161 ZFreeNotice(&retnotice);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
162 return (ZERR_INTERNAL);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
163 }
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
164
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
165 ZFreeNotice(&retnotice);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
166
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
167 return (ZERR_NONE);
1e0fa7e130d0 [gaim-migrate @ 1710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
168 }