comparison src/protocols/zephyr/zephyr.c @ 9030:7ab20f829190

[gaim-migrate @ 9806] Siege updated the code for creating right-click menu's for buddies, chats, groups, etc. It uses more stuff from the blist API and less stuff from multi.h. It also combines the code for right-click menus for chats, buddies, etc. (all types of blist nodes). So PRPLs and plugins can easily add right-click menu options to anything in the buddy list in a clean way. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 23 May 2004 17:27:45 +0000
parents 67421e0dc497
children b3bda982996b
comparison
equal deleted inserted replaced
9029:697e169dac12 9030:7ab20f829190
1142 g_snprintf(buf, 80, "%s@%s", orig, gaim_zephyr_get_realm()); 1142 g_snprintf(buf, 80, "%s@%s", orig, gaim_zephyr_get_realm());
1143 } 1143 }
1144 return buf; 1144 return buf;
1145 } 1145 }
1146 1146
1147 static void zephyr_zloc(GaimConnection * gc, const char *who) 1147 static void zephyr_zloc(GaimConnection *gc, const char *who)
1148 { 1148 {
1149 ZAsyncLocateData_t ald; 1149 ZAsyncLocateData_t ald;
1150 1150
1151 if (ZRequestLocations(local_zephyr_normalize(who), &ald, UNACKED, ZAUTH) 1151 if (ZRequestLocations(local_zephyr_normalize(who), &ald, UNACKED, ZAUTH) == ZERR_NONE) {
1152 != ZERR_NONE) { 1152 pending_zloc_names = g_list_append(pending_zloc_names,
1153 return; 1153 g_strdup(local_zephyr_normalize(who)));
1154 } 1154 }
1155 pending_zloc_names = g_list_append(pending_zloc_names, g_strdup(local_zephyr_normalize(who)));
1156 }
1157
1158 static GList *zephyr_buddy_menu(GaimConnection * gc, const char *who)
1159 {
1160 GList *m = NULL;
1161 struct proto_buddy_menu *pbm;
1162
1163 pbm = g_new0(struct proto_buddy_menu, 1);
1164
1165 pbm->label = _("ZLocate");
1166 pbm->callback = zephyr_zloc;
1167 pbm->gc = gc;
1168 m = g_list_append(m, pbm);
1169
1170 return m;
1171 } 1155 }
1172 1156
1173 static void zephyr_set_away(GaimConnection * gc, const char *state, const char *msg) 1157 static void zephyr_set_away(GaimConnection * gc, const char *state, const char *msg)
1174 { 1158 {
1175 if (gc->away) { 1159 if (gc->away) {
1305 zephyr_list_icon, 1289 zephyr_list_icon,
1306 NULL, 1290 NULL,
1307 NULL, 1291 NULL,
1308 NULL, 1292 NULL,
1309 zephyr_away_states, 1293 zephyr_away_states,
1310 zephyr_buddy_menu, 1294 NULL,
1311 zephyr_chat_info, 1295 zephyr_chat_info,
1312 zephyr_login, 1296 zephyr_login,
1313 zephyr_close, 1297 zephyr_close,
1314 zephyr_send_im, 1298 zephyr_send_im,
1315 NULL, 1299 NULL,
1346 zephyr_normalize, 1330 zephyr_normalize,
1347 NULL, 1331 NULL,
1348 NULL, 1332 NULL,
1349 NULL, 1333 NULL,
1350 zephyr_chat_set_topic, 1334 zephyr_chat_set_topic,
1351 NULL,
1352 NULL, 1335 NULL,
1353 NULL, 1336 NULL,
1354 NULL, 1337 NULL,
1355 NULL 1338 NULL
1356 }; 1339 };