| 1400 } |
1390 } |
| 1401 |
1391 |
| 1402 static gboolean |
1392 static gboolean |
| 1403 login_zeph02(zephyr_account *zephyr) |
1393 login_zeph02(zephyr_account *zephyr) |
| 1404 { |
1394 { |
| 1405 /* XXX z_call_s should actually try to report the com_err determined error */ |
1395 PurpleConnection *pc = purple_account_get_connection(zephyr->account); |
| 1406 z_call_s(ZInitialize(), "Couldn't initialize zephyr"); |
1396 |
| 1407 z_call_s(ZOpenPort(&(zephyr->port)), "Couldn't open port"); |
1397 /* XXX Should actually try to report the com_err determined error */ |
| 1408 z_call_s(ZSetLocation(zephyr->exposure), "Couldn't set location"); |
1398 if (ZInitialize() != ZERR_NONE) { |
| |
1399 purple_connection_error(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
| |
1400 "Couldn't initialize zephyr"); |
| |
1401 return FALSE; |
| |
1402 } |
| |
1403 |
| |
1404 if (ZOpenPort(&(zephyr->port)) != ZERR_NONE) { |
| |
1405 purple_connection_error(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
| |
1406 "Couldn't open port"); |
| |
1407 return FALSE; |
| |
1408 } |
| |
1409 |
| |
1410 if (ZSetLocation(zephyr->exposure) != ZERR_NONE) { |
| |
1411 purple_connection_error(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
| |
1412 "Couldn't set location"); |
| |
1413 return FALSE; |
| |
1414 } |
| 1409 |
1415 |
| 1410 zephyr->username = g_strdup(ZGetSender()); |
1416 zephyr->username = g_strdup(ZGetSender()); |
| 1411 zephyr->realm = get_zephyr_realm(zephyr->account, ZGetRealm()); |
1417 zephyr->realm = get_zephyr_realm(zephyr->account, ZGetRealm()); |
| 1412 |
1418 |
| 1413 return TRUE; |
1419 return TRUE; |
| 1594 zephyr->nottimer = 0; |
1600 zephyr->nottimer = 0; |
| 1595 if (zephyr->loctimer) |
1601 if (zephyr->loctimer) |
| 1596 g_source_remove(zephyr->loctimer); |
1602 g_source_remove(zephyr->loctimer); |
| 1597 zephyr->loctimer = 0; |
1603 zephyr->loctimer = 0; |
| 1598 if (use_zeph02(zephyr)) { |
1604 if (use_zeph02(zephyr)) { |
| 1599 z_call(ZCancelSubscriptions(0)); |
1605 if (ZCancelSubscriptions(0) != ZERR_NONE) { |
| 1600 z_call(ZUnsetLocation()); |
1606 return; |
| 1601 z_call(ZClosePort()); |
1607 } |
| |
1608 if (ZUnsetLocation() != ZERR_NONE) { |
| |
1609 return; |
| |
1610 } |
| |
1611 if (ZClosePort() != ZERR_NONE) { |
| |
1612 return; |
| |
1613 } |
| 1602 } else { |
1614 } else { |
| 1603 /* assume tzc */ |
1615 /* assume tzc */ |
| 1604 #ifdef G_OS_UNIX |
1616 #ifdef G_OS_UNIX |
| 1605 GError *error = NULL; |
1617 GError *error = NULL; |
| 1606 g_subprocess_send_signal(zephyr->tzc_proc, SIGTERM); |
1618 g_subprocess_send_signal(zephyr->tzc_proc, SIGTERM); |