Mercurial > pidgin
annotate src/protocols/msn/table.c @ 11015:45ceaa1ccc6e
[gaim-migrate @ 12884]
(10:37:16) rizzo: wtf that silc ft patch still not in
(10:38:45) LSchiere2: rizzo: what are you talking about
(10:39:03) rizzo: gaim silc won't build against silc 1.0
(10:39:16) rizzo: has been an issue since gaim 1.3.0
(10:39:29) LSchiere2: I don't recall the patch
(10:39:32) rizzo:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/*checkout*/net-im/gaim/files/gaim-1.3.0-silc-ft.patch
(10:39:41) rizzo: I thought I got it from you guys
(10:39:46) LSchiere2: is it in our tracker?
(10:39:51) rizzo: I don't see it
(10:40:05) ***rizzo digs up his bug
(10:40:57) rizzo: LSchiere2: I think pekka emailed it to -packagers list
(10:41:01) rizzo: http://bugs.gentoo.org/show_bug.cgi?id=92251
(10:41:33) rizzo: from his email:
(10:41:33) rizzo: Enclosed a small patch that makes the Gaim compile with
SILC Toolkit 1.0.
(10:41:33) rizzo: We had unfortunate timing when I released 1.0 at the
same time you
(10:41:33) rizzo: released Gaim 1.3 so I didn't have time to make the
patch for 1.3.
(10:41:33) rizzo: Anyway, the patch removes code that really isn't
supposed to even be
(10:41:33) rizzo: there...
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Fri, 17 Jun 2005 14:53:38 +0000 |
| parents | 2e01c503aa4f |
| children | bc30c6270d9f |
| rev | line source |
|---|---|
| 8810 | 1 /** |
| 2 * @file table.c MSN helper structure | |
| 3 * | |
| 4 * gaim | |
| 5 * | |
|
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
8810
diff
changeset
|
6 * Gaim is the legal property of its developers, whose names are too numerous |
|
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
8810
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
|
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
8810
diff
changeset
|
8 * source distribution. |
| 8810 | 9 * |
| 10 * This program is free software; you can redistribute it and/or modify | |
| 11 * it under the terms of the GNU General Public License as published by | |
| 12 * the Free Software Foundation; either version 2 of the License, or | |
| 13 * (at your option) any later version. | |
| 14 * | |
| 15 * This program is distributed in the hope that it will be useful, | |
| 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 * GNU General Public License for more details. | |
| 19 * | |
| 20 * You should have received a copy of the GNU General Public License | |
| 21 * along with this program; if not, write to the Free Software | |
| 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 */ | |
| 24 #include "msn.h" | |
| 25 #include "table.h" | |
| 26 | |
| 27 static void | |
| 28 null_cmd_cb(MsnCmdProc *cmdproc, MsnCommand *cmd) | |
| 29 { | |
| 30 } | |
| 31 | |
| 32 static void | |
| 33 null_error_cb(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) | |
| 34 { | |
| 35 } | |
| 36 | |
| 37 MsnTable * | |
| 38 msn_table_new() | |
| 39 { | |
| 40 MsnTable *table; | |
| 41 | |
| 42 table = g_new0(MsnTable, 1); | |
| 43 | |
| 44 table->cmds = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); | |
| 45 table->msgs = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); | |
| 46 table->errors = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); | |
| 47 | |
| 48 table->async = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); | |
| 10043 | 49 table->fallback = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); |
| 8810 | 50 |
| 51 return table; | |
| 52 } | |
| 53 | |
| 54 void | |
| 55 msn_table_destroy(MsnTable *table) | |
| 56 { | |
| 57 g_return_if_fail(table != NULL); | |
| 58 | |
| 59 g_hash_table_destroy(table->cmds); | |
| 60 g_hash_table_destroy(table->msgs); | |
| 61 g_hash_table_destroy(table->errors); | |
| 62 | |
| 63 g_hash_table_destroy(table->async); | |
| 10043 | 64 g_hash_table_destroy(table->fallback); |
| 8810 | 65 |
| 66 g_free(table); | |
| 67 } | |
| 68 | |
| 69 void | |
| 70 msn_table_add_cmd(MsnTable *table, | |
| 71 char *command, char *answer, MsnTransCb cb) | |
| 72 { | |
| 73 GHashTable *cbs; | |
| 74 | |
| 75 g_return_if_fail(table != NULL); | |
| 76 g_return_if_fail(answer != NULL); | |
| 77 | |
| 78 cbs = NULL; | |
| 79 | |
| 80 if (command == NULL) | |
| 81 { | |
| 82 cbs = table->async; | |
| 83 } | |
| 10043 | 84 else if (strcmp(command, "fallback") == 0) |
| 85 { | |
| 86 cbs = table->fallback; | |
| 87 } | |
| 8810 | 88 else |
| 89 { | |
| 90 cbs = g_hash_table_lookup(table->cmds, command); | |
| 91 | |
| 92 if (cbs == NULL) | |
| 93 { | |
| 94 cbs = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); | |
| 95 g_hash_table_insert(table->cmds, command, cbs); | |
| 96 } | |
| 97 } | |
| 98 | |
| 99 if (cb == NULL) | |
| 100 cb = null_cmd_cb; | |
| 101 | |
| 102 g_hash_table_insert(cbs, answer, cb); | |
| 103 } | |
| 104 | |
| 105 void | |
| 106 msn_table_add_error(MsnTable *table, | |
| 107 char *answer, MsnErrorCb cb) | |
| 108 { | |
| 109 g_return_if_fail(table != NULL); | |
| 110 g_return_if_fail(answer != NULL); | |
| 111 | |
| 112 if (cb == NULL) | |
| 113 cb = null_error_cb; | |
| 114 | |
| 115 g_hash_table_insert(table->errors, answer, cb); | |
| 116 } | |
| 117 | |
| 118 void | |
| 119 msn_table_add_msg_type(MsnTable *table, | |
| 10345 | 120 char *type, MsnMsgTypeCb cb) |
| 8810 | 121 { |
| 122 g_return_if_fail(table != NULL); | |
| 123 g_return_if_fail(type != NULL); | |
| 124 g_return_if_fail(cb != NULL); | |
| 125 | |
| 126 #if 0 | |
| 127 if (cb == NULL) | |
| 128 cb = null_msg_cb; | |
| 129 #endif | |
| 130 | |
| 131 g_hash_table_insert(table->msgs, type, cb); | |
| 132 } |
