Mercurial > pidgin
annotate plugins/ssl/ssl.c @ 12468:6faefbebcd24
[gaim-migrate @ 14778]
SF Patch #1372898 from charkins
"This patch updates the unseen conversation api in
gtkconv to ensure consistancy and avoid code
duplication. The ...first_unseen() function is renamed
and expanded to return a list of conversations that
match the specified criteria. A max_count parameter is
used to allow this to short circuit early (using 1
gives old behavior). An additional flag was added to
allow this function to only consider hidden
conversations (used by the buddy list). The blist is
currently inconsistant in which conversations it loops
over for showing the menu tray icon, creating the
tooltip and the unseen menu. This patch fixes that.
The ...find_unseen_list() now handles contact-aware
conversations correctly as well (based on sadrul's
patches in #1362579 which are obsoleted by this patch).
I also included the fix from #1362579 which increments
unseen_count only when state>=UNSEEN_TEXT."
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Mon, 12 Dec 2005 18:59:29 +0000 |
| parents | f8e395a054e2 |
| children |
| rev | line source |
|---|---|
| 7016 | 1 /** |
| 2 * @file ssl.c Main SSL plugin | |
| 3 * | |
| 4 * gaim | |
| 5 * | |
| 6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> | |
| 7 * | |
| 8 * This program is free software; you can redistribute it and/or modify | |
| 9 * it under the terms of the GNU General Public License as published by | |
| 10 * the Free Software Foundation; either version 2 of the License, or | |
| 11 * (at your option) any later version. | |
| 12 * | |
| 13 * This program is distributed in the hope that it will be useful, | |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 * GNU General Public License for more details. | |
| 17 * | |
| 18 * You should have received a copy of the GNU General Public License | |
| 19 * along with this program; if not, write to the Free Software | |
| 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 */ | |
| 22 #include "internal.h" | |
| 23 #include "debug.h" | |
| 24 #include "plugin.h" | |
| 25 #include "sslconn.h" | |
| 9943 | 26 #include "version.h" |
| 7016 | 27 |
| 28 #define SSL_PLUGIN_ID "core-ssl" | |
| 29 | |
| 30 static GaimPlugin *ssl_plugin = NULL; | |
| 31 | |
| 32 static gboolean | |
| 33 probe_ssl_plugins(GaimPlugin *my_plugin) | |
| 34 { | |
| 35 GaimPlugin *plugin; | |
| 36 GList *l; | |
| 37 | |
| 38 ssl_plugin = NULL; | |
| 39 | |
| 40 for (l = gaim_plugins_get_all(); l != NULL; l = l->next) | |
| 41 { | |
| 42 plugin = (GaimPlugin *)l->data; | |
| 43 | |
| 44 if (plugin == my_plugin) | |
| 45 continue; | |
| 46 | |
| 47 if (plugin->info != NULL && plugin->info->id != NULL && | |
| 48 strncmp(plugin->info->id, "ssl-", 4) == 0) | |
| 49 { | |
| 50 if (gaim_plugin_is_loaded(plugin) || gaim_plugin_load(plugin)) | |
| 51 { | |
| 52 ssl_plugin = plugin; | |
| 53 | |
| 54 break; | |
| 55 } | |
| 56 } | |
| 57 } | |
| 58 | |
| 59 return (ssl_plugin != NULL); | |
| 60 } | |
| 61 | |
| 62 static gboolean | |
| 63 plugin_load(GaimPlugin *plugin) | |
| 64 { | |
| 65 return probe_ssl_plugins(plugin); | |
| 66 } | |
| 67 | |
| 68 static gboolean | |
| 69 plugin_unload(GaimPlugin *plugin) | |
| 70 { | |
|
7040
ccadd1da839b
[gaim-migrate @ 7603]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
71 if (ssl_plugin != NULL && |
|
7041
a671a28bc50b
[gaim-migrate @ 7604]
Christian Hammond <chipx86@chipx86.com>
parents:
7040
diff
changeset
|
72 g_list_find(gaim_plugins_get_loaded(), ssl_plugin) != NULL) |
| 7016 | 73 { |
| 74 gaim_plugin_unload(ssl_plugin); | |
|
7040
ccadd1da839b
[gaim-migrate @ 7603]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
75 } |
| 7016 | 76 |
|
7040
ccadd1da839b
[gaim-migrate @ 7603]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
77 ssl_plugin = NULL; |
| 7016 | 78 |
| 79 return TRUE; | |
| 80 } | |
| 81 | |
| 82 static GaimPluginInfo info = | |
| 83 { | |
| 9943 | 84 GAIM_PLUGIN_MAGIC, |
| 85 GAIM_MAJOR_VERSION, | |
| 86 GAIM_MINOR_VERSION, | |
| 7016 | 87 GAIM_PLUGIN_STANDARD, /**< type */ |
| 88 NULL, /**< ui_requirement */ | |
| 89 GAIM_PLUGIN_FLAG_INVISIBLE, /**< flags */ | |
| 90 NULL, /**< dependencies */ | |
| 91 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
| 92 | |
| 93 SSL_PLUGIN_ID, /**< id */ | |
| 94 N_("SSL"), /**< name */ | |
| 95 VERSION, /**< version */ | |
| 96 /** summary */ | |
| 97 N_("Provides a wrapper around SSL support libraries."), | |
| 98 /** description */ | |
| 99 N_("Provides a wrapper around SSL support libraries."), | |
| 100 "Christian Hammond <chipx86@gnupdate.org>", | |
| 101 GAIM_WEBSITE, /**< homepage */ | |
| 102 | |
| 103 plugin_load, /**< load */ | |
| 104 plugin_unload, /**< unload */ | |
| 105 NULL, /**< destroy */ | |
| 106 | |
| 107 NULL, /**< ui_info */ | |
| 8993 | 108 NULL, /**< extra_info */ |
| 109 NULL, | |
| 110 NULL | |
| 7016 | 111 }; |
| 112 | |
| 113 static void | |
| 114 init_plugin(GaimPlugin *plugin) | |
| 115 { | |
| 116 } | |
| 117 | |
| 118 GAIM_INIT_PLUGIN(ssl, init_plugin, info) |
