comparison mcabber/src/roster.c @ 1043:ebbde723614b

Store contacts PGP keys Contacts PGP keys are retrieved from presence/message signatures; they're displayed with /info.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 26 Nov 2006 17:08:21 +0100
parents 54405d09b15a
children c0d44a9a99bc
comparison
equal deleted inserted replaced
1042:8a395c2cafc4 1043:ebbde723614b
56 struct jep0022 jep22; 56 struct jep0022 jep22;
57 #endif 57 #endif
58 #ifdef JEP0085 58 #ifdef JEP0085
59 struct jep0085 jep85; 59 struct jep0085 jep85;
60 #endif 60 #endif
61 #ifdef HAVE_GPGME
62 struct pgp_data pgpdata;
63 #endif
61 } res; 64 } res;
62 65
63 /* This is a private structure type for the roster */ 66 /* This is a private structure type for the roster */
64 67
65 typedef struct { 68 typedef struct {
123 g_free((gchar*)p_res->realjid); 126 g_free((gchar*)p_res->realjid);
124 #ifdef JEP0022 127 #ifdef JEP0022
125 g_free(p_res->jep22.last_msgid_sent); 128 g_free(p_res->jep22.last_msgid_sent);
126 g_free(p_res->jep22.last_msgid_rcvd); 129 g_free(p_res->jep22.last_msgid_rcvd);
127 #endif 130 #endif
131 #ifdef HAVE_GPGME
132 g_free(p_res->pgpdata.sign_keyid);
133 #endif
128 } 134 }
129 // Free all nodes but the first (which is static) 135 // Free all nodes but the first (which is static)
130 g_slist_free(*reslist); 136 g_slist_free(*reslist);
131 *reslist = NULL; 137 *reslist = NULL;
132 } 138 }
220 g_free(p_res->status_msg); 226 g_free(p_res->status_msg);
221 g_free(p_res->realjid); 227 g_free(p_res->realjid);
222 #ifdef JEP0022 228 #ifdef JEP0022
223 g_free(p_res->jep22.last_msgid_sent); 229 g_free(p_res->jep22.last_msgid_sent);
224 g_free(p_res->jep22.last_msgid_rcvd); 230 g_free(p_res->jep22.last_msgid_rcvd);
231 #endif
232 #ifdef HAVE_GPGME
233 g_free(p_res->pgpdata.sign_keyid);
225 #endif 234 #endif
226 rost->resource = g_slist_delete_link(rost->resource, p_res_elt); 235 rost->resource = g_slist_delete_link(rost->resource, p_res_elt);
227 return; 236 return;
228 } 237 }
229 238
1115 return &p_res->jep85; 1124 return &p_res->jep85;
1116 #endif 1125 #endif
1117 return NULL; 1126 return NULL;
1118 } 1127 }
1119 1128
1129 struct pgp_data *buddy_resource_pgp(gpointer rosterdata, const char *resname)
1130 {
1131 #ifdef HAVE_GPGME
1132 roster *roster_usr = rosterdata;
1133 res *p_res = get_resource(roster_usr, resname);
1134 if (p_res)
1135 return &p_res->pgpdata;
1136 #endif
1137 return NULL;
1138 }
1139
1140
1120 enum imrole buddy_getrole(gpointer rosterdata, const char *resname) 1141 enum imrole buddy_getrole(gpointer rosterdata, const char *resname)
1121 { 1142 {
1122 roster *roster_usr = rosterdata; 1143 roster *roster_usr = rosterdata;
1123 res *p_res = get_resource(roster_usr, resname); 1144 res *p_res = get_resource(roster_usr, resname);
1124 if (p_res) 1145 if (p_res)