Mon, 22 Aug 2022 21:40:04 -0500
Inline pidgin_make_scrollable
We need to change it for GTK4, and there are few enough that it can be inlined. Eventually, that code might be a `.ui` anyway.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/1615/
|
40750
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
1 | /* |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
4 | * |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
8 | * |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
13 | * |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
18 | * |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
21 | */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
22 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
23 | #include <glib/gi18n-lib.h> |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
24 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
25 | #include "zephyr_zeph02.h" |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
26 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
27 | gboolean |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
28 | zeph02_login(zephyr_account *zephyr) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
29 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
30 | PurpleConnection *pc = purple_account_get_connection(zephyr->account); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
31 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
32 | /* XXX Should actually try to report the com_err determined error */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
33 | if (ZInitialize() != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
34 | purple_connection_error(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
35 | "Couldn't initialize zephyr"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
36 | return FALSE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
37 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
38 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
39 | if (ZOpenPort(&(zephyr->port)) != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
40 | purple_connection_error(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
41 | "Couldn't open port"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
42 | return FALSE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
43 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
44 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
45 | if (ZSetLocation(zephyr->exposure) != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
46 | purple_connection_error(pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
47 | "Couldn't set location"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
48 | return FALSE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
49 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
50 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
51 | zephyr->username = g_strdup(ZGetSender()); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
52 | zephyr->realm = get_zephyr_realm(zephyr->account, ZGetRealm()); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
53 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
54 | return TRUE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
55 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
56 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
57 | /* Called when the server notifies us a message couldn't get sent */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
58 | static void |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
59 | message_failed(PurpleConnection *gc, ZNotice_t *notice) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
60 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
61 | const gchar *title; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
62 | gchar *notify_msg; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
63 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
64 | if (g_ascii_strcasecmp(notice->z_class, "message")) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
65 | title = ""; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
66 | notify_msg = g_strdup_printf(_("Unable to send to chat %s,%s,%s"), |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
67 | notice->z_class, notice->z_class_inst, notice->z_recipient); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
68 | } else { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
69 | title = notice->z_recipient; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
70 | notify_msg = g_strdup(_("User is offline")); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
71 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
72 | purple_notify_error(gc, title, notify_msg, NULL, purple_request_cpar_from_connection(gc)); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
73 | g_free(notify_msg); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
74 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
75 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
76 | /* just for debugging */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
77 | static void |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
78 | handle_unknown(ZNotice_t *notice) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
79 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
80 | purple_debug_error("zephyr", "z_packet: %s\n", notice->z_packet); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
81 | purple_debug_error("zephyr", "z_version: %s\n", notice->z_version); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
82 | purple_debug_error("zephyr", "z_kind: %d\n", (int)(notice->z_kind)); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
83 | purple_debug_error("zephyr", "z_class: %s\n", notice->z_class); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
84 | purple_debug_error("zephyr", "z_class_inst: %s\n", notice->z_class_inst); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
85 | purple_debug_error("zephyr", "z_opcode: %s\n", notice->z_opcode); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
86 | purple_debug_error("zephyr", "z_sender: %s\n", notice->z_sender); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
87 | purple_debug_error("zephyr", "z_recipient: %s\n", notice->z_recipient); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
88 | purple_debug_error("zephyr", "z_message: %s\n", notice->z_message); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
89 | purple_debug_error("zephyr", "z_message_len: %d\n", notice->z_message_len); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
90 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
91 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
92 | gint |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
93 | zeph02_check_notify(gpointer data) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
94 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
95 | /* XXX add real error reporting */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
96 | PurpleConnection *gc = (PurpleConnection*) data; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
97 | while (ZPending()) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
98 | ZNotice_t notice; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
99 | /* XXX add real error reporting */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
100 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
101 | if (ZReceiveNotice(¬ice, NULL) != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
102 | return TRUE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
103 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
104 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
105 | switch (notice.z_kind) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
106 | case UNSAFE: |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
107 | case UNACKED: |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
108 | case ACKED: |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
109 | handle_message(gc, ¬ice); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
110 | break; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
111 | case SERVACK: |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
112 | if (!(g_ascii_strcasecmp(notice.z_message, ZSRVACK_NOTSENT))) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
113 | message_failed(gc, ¬ice); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
114 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
115 | break; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
116 | case CLIENTACK: |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
117 | purple_debug_error("zephyr", "Client ack received\n"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
118 | handle_unknown(¬ice); /* XXX: is it really unknown? */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
119 | break; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
120 | default: |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
121 | /* we'll just ignore things for now */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
122 | handle_unknown(¬ice); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
123 | purple_debug_error("zephyr", "Unhandled notice.\n"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
124 | break; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
125 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
126 | /* XXX add real error reporting */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
127 | ZFreeNotice(¬ice); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
128 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
129 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
130 | return TRUE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
131 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
132 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
133 | gboolean |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
134 | zeph02_subscribe_to(G_GNUC_UNUSED zephyr_account *zephyr, ZSubscription_t *sub) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
135 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
136 | return ZSubscribeTo(sub, 1, 0) == ZERR_NONE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
137 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
138 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
139 | gboolean |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
140 | zeph02_request_locations(G_GNUC_UNUSED zephyr_account *zephyr, gchar *who) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
141 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
142 | ZAsyncLocateData_t ald; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
143 | Code_t zerr; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
144 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
145 | zerr = ZRequestLocations(who, &ald, UNACKED, ZAUTH); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
146 | g_free(ald.user); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
147 | g_free(ald.version); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
148 | return zerr == ZERR_NONE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
149 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
150 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
151 | gboolean |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
152 | zeph02_send_message(G_GNUC_UNUSED zephyr_account *zephyr, gchar *zclass, gchar *instance, gchar *recipient, |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
153 | const gchar *html_buf, const gchar *sig, const gchar *opcode) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
154 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
155 | ZNotice_t notice; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
156 | char *buf = g_strdup_printf("%s%c%s", sig, '\0', html_buf); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
157 | gboolean result = TRUE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
158 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
159 | memset((char *)¬ice, 0, sizeof(notice)); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
160 | notice.z_kind = ACKED; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
161 | notice.z_port = 0; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
162 | notice.z_class = zclass; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
163 | notice.z_class_inst = instance; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
164 | notice.z_recipient = recipient; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
165 | notice.z_sender = 0; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
166 | notice.z_default_format = "Class $class, Instance $instance:\n" "To: @bold($recipient) at $time $date\n" "From: @bold($1) <$sender>\n\n$2"; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
167 | notice.z_message_len = strlen(sig) + 1 + strlen(html_buf) + 1; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
168 | notice.z_message = buf; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
169 | notice.z_opcode = g_strdup(opcode); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
170 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
171 | purple_debug_info("zephyr","About to send notice\n"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
172 | if (ZSendNotice(¬ice, ZAUTH) != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
173 | /* XXX handle errors here */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
174 | result = FALSE; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
175 | } else { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
176 | purple_debug_info("zephyr", "notice sent\n"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
177 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
178 | g_free(buf); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
179 | return result; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
180 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
181 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
182 | void |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
183 | zeph02_set_location(G_GNUC_UNUSED zephyr_account *zephyr, char *exposure) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
184 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
185 | ZSetLocation(exposure); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
186 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
187 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
188 | void |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
189 | zeph02_get_subs_from_server(zephyr_account *zephyr, PurpleConnection *gc) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
190 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
191 | Code_t retval; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
192 | int nsubs; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
193 | GString *subout; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
194 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
195 | if (zephyr->port == 0) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
196 | purple_debug_error("zephyr", "error while retrieving port\n"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
197 | return; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
198 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
199 | if ((retval = ZRetrieveSubscriptions(zephyr->port, &nsubs)) != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
200 | /* XXX better error handling */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
201 | purple_debug_error("zephyr", "error while retrieving subscriptions from server\n"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
202 | return; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
203 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
204 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
205 | subout = g_string_new("Subscription list<br>"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
206 | for (int i = 0; i < nsubs; i++) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
207 | ZSubscription_t subs; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
208 | int one = 1; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
209 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
210 | if ((retval = ZGetSubscriptions(&subs, &one)) != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
211 | break; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
212 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
213 | g_string_append_printf(subout, "Class %s Instance %s Recipient %s<br>", |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
214 | subs.zsub_class, subs.zsub_classinst, subs.zsub_recipient); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
215 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
216 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
217 | if (retval == ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
218 | gchar *title = g_strdup_printf("Server subscriptions for %s", zephyr->username); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
219 | purple_notify_formatted(gc, title, title, NULL, subout->str, NULL, NULL); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
220 | g_free(title); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
221 | } else { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
222 | /* XXX better error handling */ |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
223 | purple_debug_error("zephyr", "error while retrieving individual subscription\n"); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
224 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
225 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
226 | g_string_free(subout, TRUE); |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
227 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
228 | |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
229 | void |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
230 | zeph02_close(G_GNUC_UNUSED zephyr_account *zephyr) |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
231 | { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
232 | if (ZCancelSubscriptions(0) != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
233 | return; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
234 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
235 | if (ZUnsetLocation() != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
236 | return; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
237 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
238 | if (ZClosePort() != ZERR_NONE) { |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
239 | return; |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
240 | } |
|
e87c321f05fa
Move tzc and zeph02 to own modules and some cleanup
Arkadiy Illarionov <qarkai@gmail.com>
parents:
diff
changeset
|
241 | } |