- Timestamp:
- 2008-07-16T23:22:52Z (16 years ago)
- Branches:
- master
- Children:
- 9b55485
- Parents:
- 9730d72 (diff), 6a78c0e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
otr.c
r9730d72 r6738a67 46 46 #include <unistd.h> 47 47 #include <assert.h> 48 #include <signal.h> 48 49 49 50 … … 102 103 }; 103 104 105 typedef struct { 106 void *fst; 107 void *snd; 108 } pair_t; 109 104 110 105 111 /** misc. helpers/subroutines: **/ … … 124 130 125 131 /* some yes/no handlers */ 126 void yes_keygen( gpointer w,void *data);127 void yes_forget_fingerprint( gpointer w,void *data);128 void yes_forget_context( gpointer w,void *data);129 void yes_forget_key( gpointer w,void *data);132 void yes_keygen(void *data); 133 void yes_forget_fingerprint(void *data); 134 void yes_forget_context(void *data); 135 void yes_forget_key(void *data); 130 136 131 137 /* helper to make sure accountname and protocol match the incoming "opdata" */ … … 841 847 } 842 848 843 void yes_forget_fingerprint(gpointer w, void *data) 844 { 845 irc_t *irc = (irc_t *)w; 846 Fingerprint *fp = (Fingerprint *)data; 849 void yes_forget_fingerprint(void *data) 850 { 851 pair_t *p = (pair_t *)data; 852 irc_t *irc = (irc_t *)p->fst; 853 Fingerprint *fp = (Fingerprint *)p->snd; 854 855 g_free(p); 847 856 848 857 if(fp == fp->context->active_fingerprint) { … … 854 863 } 855 864 856 void yes_forget_context(gpointer w, void *data) 857 { 858 irc_t *irc = (irc_t *)w; 859 ConnContext *ctx = (ConnContext *)data; 865 void yes_forget_context(void *data) 866 { 867 pair_t *p = (pair_t *)data; 868 irc_t *irc = (irc_t *)p->fst; 869 ConnContext *ctx = (ConnContext *)p->snd; 870 871 g_free(p); 860 872 861 873 if(ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) { … … 870 882 } 871 883 872 void yes_forget_key( gpointer w,void *data)884 void yes_forget_key(void *data) 873 885 { 874 886 OtrlPrivKey *key = (OtrlPrivKey *)data; … … 889 901 char human[54]; 890 902 char *s; 903 pair_t *p; 891 904 892 905 if(!args[3]) { … … 922 935 otrl_privkey_hash_to_human(human, fp->fingerprint); 923 936 s = g_strdup_printf("about to forget fingerprint %s, are you sure?", human); 924 query_add(irc, NULL, s, yes_forget_fingerprint, NULL, fp); 937 p = g_malloc(sizeof(pair_t)); 938 if(!p) 939 return; 940 p->fst = irc; 941 p->snd = fp; 942 query_add(irc, NULL, s, yes_forget_fingerprint, NULL, p); 925 943 g_free(s); 926 944 } … … 931 949 ConnContext *ctx; 932 950 char *s; 951 pair_t *p; 933 952 934 953 /* TODO: allow context specs ("user/proto/account") in 'otr forget contex'? */ … … 952 971 953 972 s = g_strdup_printf("about to forget otr data about %s, are you sure?", args[2]); 954 query_add(irc, NULL, s, yes_forget_context, NULL, ctx); 973 p = g_malloc(sizeof(pair_t)); 974 if(!p) 975 return; 976 p->fst = irc; 977 p->snd = ctx; 978 query_add(irc, NULL, s, yes_forget_context, NULL, p); 955 979 g_free(s); 956 980 } … … 1660 1684 } 1661 1685 1662 void yes_keygen( gpointer w,void *data)1686 void yes_keygen(void *data) 1663 1687 { 1664 1688 account_t *acc = (account_t *)data;
Note: See TracChangeset
for help on using the changeset viewer.