comparison mcabber/mcabber/commands.c @ 1682:d1e8fb14ce2d

Destroy lm connection object on disconnect
author Myhailo Danylenko <isbear@ukrpost.net>
date Tue, 19 Jan 2010 09:53:12 +0200
parents 1d84f5be2ad1
children 95df4ea512c8
comparison
equal deleted inserted replaced
1681:687f6b515d87 1682:d1e8fb14ce2d
886 char **paramlst; 886 char **paramlst;
887 char *status; 887 char *status;
888 char *msg; 888 char *msg;
889 enum imstatus st; 889 enum imstatus st;
890 890
891 if (!lm_connection_is_authenticated(lconnection)) { 891 if (!lconnection || !lm_connection_is_authenticated(lconnection)) {
892 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); 892 scr_LogPrint(LPRINT_NORMAL, "You are not connected.");
893 return; 893 return;
894 } 894 }
895 895
896 // It makes sense to reset autoaway before changing the status 896 // It makes sense to reset autoaway before changing the status
1020 { 1020 {
1021 char **paramlst; 1021 char **paramlst;
1022 char *id, *nick; 1022 char *id, *nick;
1023 char *jid_utf8 = NULL; 1023 char *jid_utf8 = NULL;
1024 1024
1025 if (!lm_connection_is_authenticated(lconnection)) { 1025 if (!lconnection || !lm_connection_is_authenticated(lconnection)) {
1026 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); 1026 scr_LogPrint(LPRINT_NORMAL, "You are not connected.");
1027 return; 1027 return;
1028 } 1028 }
1029 1029
1030 paramlst = split_arg(arg, 2, 0); // jid, [nickname] 1030 paramlst = split_arg(arg, 2, 0); // jid, [nickname]
1182 gint crypted; 1182 gint crypted;
1183 gint retval = 0; 1183 gint retval = 0;
1184 int isroom; 1184 int isroom;
1185 gpointer xep184 = NULL; 1185 gpointer xep184 = NULL;
1186 1186
1187 if (!lm_connection_is_authenticated(lconnection)) { 1187 if (!lconnection || !lm_connection_is_authenticated(lconnection)) {
1188 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); 1188 scr_LogPrint(LPRINT_NORMAL, "You are not connected.");
1189 return 1; 1189 return 1;
1190 } 1190 }
1191 if (!fjid || !*fjid) { 1191 if (!fjid || !*fjid) {
1192 scr_LogPrint(LPRINT_NORMAL, "You must specify a Jabber ID."); 1192 scr_LogPrint(LPRINT_NORMAL, "You must specify a Jabber ID.");
1527 char *fjid, *msg; 1527 char *fjid, *msg;
1528 char *file = NULL; 1528 char *file = NULL;
1529 LmMessageSubType msg_type = LM_MESSAGE_SUB_TYPE_NOT_SET; 1529 LmMessageSubType msg_type = LM_MESSAGE_SUB_TYPE_NOT_SET;
1530 bool quiet = FALSE; 1530 bool quiet = FALSE;
1531 1531
1532 if (!lm_connection_is_authenticated(lconnection)) { 1532 if (!lconnection || !lm_connection_is_authenticated(lconnection)) {
1533 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); 1533 scr_LogPrint(LPRINT_NORMAL, "You are not connected.");
1534 return; 1534 return;
1535 } 1535 }
1536 1536
1537 msg_type = scan_mtype(&arg); 1537 msg_type = scan_mtype(&arg);
2247 static void do_rawxml(char *arg) 2247 static void do_rawxml(char *arg)
2248 { 2248 {
2249 char **paramlst; 2249 char **paramlst;
2250 char *subcmd; 2250 char *subcmd;
2251 2251
2252 if (!lm_connection_is_authenticated(lconnection)) { 2252 if (!lconnection || !lm_connection_is_authenticated(lconnection)) {
2253 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); 2253 scr_LogPrint(LPRINT_NORMAL, "You are not connected.");
2254 return; 2254 return;
2255 } 2255 }
2256 2256
2257 paramlst = split_arg(arg, 2, 1); // subcmd, arg 2257 paramlst = split_arg(arg, 2, 1); // subcmd, arg
3040 { 3040 {
3041 char **paramlst; 3041 char **paramlst;
3042 char *subcmd; 3042 char *subcmd;
3043 gpointer bud; 3043 gpointer bud;
3044 3044
3045 if (!lm_connection_is_authenticated(lconnection)) { 3045 if (!lconnection || !lm_connection_is_authenticated(lconnection)) {
3046 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); 3046 scr_LogPrint(LPRINT_NORMAL, "You are not connected.");
3047 return; 3047 return;
3048 } 3048 }
3049 3049
3050 paramlst = split_arg(arg, 2, 1); // subcmd, arg 3050 paramlst = split_arg(arg, 2, 1); // subcmd, arg
3137 { 3137 {
3138 char **paramlst; 3138 char **paramlst;
3139 char *subcmd; 3139 char *subcmd;
3140 char *jid_utf8; 3140 char *jid_utf8;
3141 3141
3142 if (!lm_connection_is_authenticated(lconnection)) { 3142 if (!lconnection || !lm_connection_is_authenticated(lconnection)) {
3143 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); 3143 scr_LogPrint(LPRINT_NORMAL, "You are not connected.");
3144 return; 3144 return;
3145 } 3145 }
3146 3146
3147 paramlst = split_arg(arg, 2, 0); // subcmd, [jid] 3147 paramlst = split_arg(arg, 2, 0); // subcmd, [jid]
3251 "Please specify a query type (version, time...)."); 3251 "Please specify a query type (version, time...).");
3252 free_arg_lst(paramlst); 3252 free_arg_lst(paramlst);
3253 return; 3253 return;
3254 } 3254 }
3255 3255
3256 if (!lm_connection_is_authenticated(lconnection)) { 3256 if (!lconnection || !lm_connection_is_authenticated(lconnection)) {
3257 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); 3257 scr_LogPrint(LPRINT_NORMAL, "You are not connected.");
3258 free_arg_lst(paramlst); 3258 free_arg_lst(paramlst);
3259 return; 3259 return;
3260 } 3260 }
3261 3261