Changeset a5f4040
- Timestamp:
- 2008-12-21T20:08:44Z (16 years ago)
- Branches:
- master
- Children:
- 5adcc65
- Parents:
- a2ed574
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skype.c
ra2ed574 ra5f4040 147 147 */ 148 148 149 int skype_write( struct im_connection *ic, char *buf , int len)149 int skype_write( struct im_connection *ic, char *buf ) 150 150 { 151 151 struct skype_data *sd = ic->proto_data; 152 152 struct pollfd pfd[1]; 153 int len = strlen(buf); 153 154 154 155 pfd[0].fd = sd->fd; … … 172 173 struct skype_buddy_ask_data *bla = data; 173 174 char *buf = g_strdup_printf("SET USER %s ISAUTHORIZED TRUE", bla->handle); 174 skype_write( bla->ic, buf , strlen( buf ));175 skype_write( bla->ic, buf ); 175 176 g_free(buf); 176 177 g_free(bla->handle); … … 182 183 struct skype_buddy_ask_data *bla = data; 183 184 char *buf = g_strdup_printf("SET USER %s ISAUTHORIZED FALSE", bla->handle); 184 skype_write( bla->ic, buf , strlen( buf ));185 skype_write( bla->ic, buf ); 185 186 g_free(buf); 186 187 g_free(bla->handle); … … 205 206 struct skype_buddy_ask_data *bla = data; 206 207 char *buf = g_strdup_printf("SET CALL %s STATUS INPROGRESS", bla->handle); 207 skype_write( bla->ic, buf , strlen( buf ));208 skype_write( bla->ic, buf ); 208 209 g_free(buf); 209 210 g_free(bla->handle); … … 215 216 struct skype_buddy_ask_data *bla = data; 216 217 char *buf = g_strdup_printf("SET CALL %s STATUS FINISHED", bla->handle); 217 skype_write( bla->ic, buf , strlen( buf ));218 skype_write( bla->ic, buf ); 218 219 g_free(buf); 219 220 g_free(bla->handle); … … 307 308 { 308 309 g_snprintf(buf, 1024, "GET USER %s ONLINESTATUS\n", *i); 309 skype_write( ic, buf , strlen( buf ));310 skype_write( ic, buf ); 310 311 i++; 311 312 } … … 540 541 */ 541 542 g_snprintf(buf, 1024, "GET CHATMESSAGE %s FROM_HANDLE\n", id); 542 skype_write( ic, buf , strlen( buf ));543 skype_write( ic, buf ); 543 544 g_snprintf(buf, 1024, "GET CHATMESSAGE %s BODY\n", id); 544 skype_write( ic, buf , strlen( buf ));545 skype_write( ic, buf ); 545 546 g_snprintf(buf, 1024, "GET CHATMESSAGE %s TYPE\n", id); 546 skype_write( ic, buf , strlen( buf ));547 skype_write( ic, buf ); 547 548 g_snprintf(buf, 1024, "GET CHATMESSAGE %s CHATNAME\n", id); 548 skype_write( ic, buf , strlen( buf ));549 skype_write( ic, buf ); 549 550 } 550 551 else if(!strncmp(info, "FROM_HANDLE ", 12)) … … 640 641 sd->call_id = g_strdup(id); 641 642 g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id); 642 skype_write( ic, buf , strlen( buf ));643 skype_write( ic, buf ); 643 644 sd->call_status = SKYPE_CALL_RINGING; 644 645 } … … 646 647 { 647 648 g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id); 648 skype_write( ic, buf , strlen( buf ));649 skype_write( ic, buf ); 649 650 sd->call_status = SKYPE_CALL_MISSED; 650 651 } … … 652 653 { 653 654 g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id); 654 skype_write( ic, buf , strlen( buf ));655 skype_write( ic, buf ); 655 656 sd->call_status = SKYPE_CALL_CANCELLED; 656 657 } … … 658 659 { 659 660 g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id); 660 skype_write( ic, buf , strlen( buf ));661 skype_write( ic, buf ); 661 662 sd->call_status = SKYPE_CALL_FINISHED; 662 663 } … … 664 665 { 665 666 g_snprintf(buf, 1024, "GET CALL %s PARTNER_HANDLE\n", id); 666 skype_write( ic, buf , strlen( buf ));667 skype_write( ic, buf ); 667 668 sd->call_status = SKYPE_CALL_REFUSED; 668 669 } … … 743 744 { 744 745 g_snprintf(buf, 1024, "GET FILETRANSFER %s PARTNER_HANDLE\n", id); 745 skype_write( ic, buf , strlen( buf ));746 skype_write( ic, buf ); 746 747 sd->filetransfer_status = SKYPE_FILETRANSFER_NEW; 747 748 } … … 749 750 { 750 751 g_snprintf(buf, 1024, "GET FILETRANSFER %s PARTNER_HANDLE\n", id); 751 skype_write( ic, buf , strlen( buf ));752 skype_write( ic, buf ); 752 753 sd->filetransfer_status = SKYPE_FILETRANSFER_FAILED; 753 754 } … … 787 788 imcb_chat_new( ic, id ); 788 789 g_snprintf(buf, 1024, "GET CHAT %s ADDER\n", id); 789 skype_write(ic, buf , strlen(buf));790 skype_write(ic, buf); 790 791 g_snprintf(buf, 1024, "GET CHAT %s TOPIC\n", id); 791 skype_write(ic, buf , strlen(buf));792 skype_write(ic, buf); 792 793 } 793 794 else if(!strcmp(info, "STATUS DIALOG") && sd->groupchat_with) … … 801 802 * just leave it out. */ 802 803 /*g_snprintf(buf, 1024, "OPEN CHAT %s\n", id); 803 skype_write(ic, buf , strlen(buf));*/804 skype_write(ic, buf);*/ 804 805 g_snprintf(buf, 1024, "%s@skype.com", sd->groupchat_with); 805 806 imcb_chat_add_buddy(gc, buf); … … 808 809 sd->groupchat_with = NULL; 809 810 g_snprintf(buf, 1024, "GET CHAT %s ADDER\n", id); 810 skype_write(ic, buf , strlen(buf));811 skype_write(ic, buf); 811 812 g_snprintf(buf, 1024, "GET CHAT %s TOPIC\n", id); 812 skype_write(ic, buf , strlen(buf));813 skype_write(ic, buf); 813 814 } 814 815 else if(!strcmp(info, "STATUS UNSUBSCRIBED")) … … 883 884 { 884 885 g_snprintf(buf, 1024, "PONG\n"); 885 skype_write(ic, buf , strlen(buf));886 skype_write(ic, buf); 886 887 } 887 888 else if(!strncmp(line, "CHATS ", 6)) … … 894 895 { 895 896 g_snprintf(buf, 1024, "GET CHAT %s STATUS\n", *i); 896 skype_write( ic, buf , strlen( buf ));897 skype_write( ic, buf ); 897 898 g_snprintf(buf, 1024, "GET CHAT %s ACTIVEMEMBERS\n", *i); 898 skype_write( ic, buf , strlen( buf ));899 skype_write( ic, buf ); 899 900 i++; 900 901 } … … 931 932 /* Log in */ 932 933 buf = g_strdup_printf("USERNAME %s\n", ic->acc->user); 933 st = skype_write( ic, buf , strlen( buf ));934 st = skype_write( ic, buf ); 934 935 g_free(buf); 935 936 buf = g_strdup_printf("PASSWORD %s\n", ic->acc->pass); 936 st = skype_write( ic, buf , strlen( buf ));937 st = skype_write( ic, buf ); 937 938 g_free(buf); 938 939 939 940 /* This will download all buddies. */ 940 941 buf = g_strdup_printf("SEARCH FRIENDS\n"); 941 st = skype_write( ic, buf , strlen( buf ));942 st = skype_write( ic, buf ); 942 943 g_free(buf); 943 944 buf = g_strdup_printf("SET USERSTATUS ONLINE\n"); 944 skype_write( ic, buf , strlen( buf ));945 skype_write( ic, buf ); 945 946 g_free(buf); 946 947 … … 948 949 if (set_getbool(&ic->acc->set, "auto_join")) { 949 950 buf = g_strdup_printf("SEARCH BOOKMARKEDCHATS\n"); 950 skype_write( ic, buf , strlen( buf ));951 skype_write( ic, buf ); 951 952 g_free(buf); 952 953 } … … 993 994 994 995 buf = g_strdup_printf("SET USERSTATUS OFFLINE\n"); 995 skype_write( ic, buf , strlen( buf ));996 skype_write( ic, buf ); 996 997 g_free(buf); 997 998 … … 1017 1018 buf = g_strdup_printf("MESSAGE %s %s\n", nick, message); 1018 1019 g_free(nick); 1019 st = skype_write( ic, buf , strlen( buf ));1020 st = skype_write( ic, buf ); 1020 1021 g_free(buf); 1021 1022 … … 1044 1045 state = skype_away_state_by_name( state_txt ); 1045 1046 buf = g_strdup_printf("SET USERSTATUS %s\n", state->code); 1046 skype_write( ic, buf , strlen( buf ));1047 skype_write( ic, buf ); 1047 1048 g_free(buf); 1048 1049 } … … 1067 1068 1068 1069 buf = g_strdup_printf("SET PROFILE FULLNAME %s", value); 1069 skype_write( ic, buf , strlen( buf ));1070 skype_write( ic, buf ); 1070 1071 g_free(buf); 1071 1072 return(value); … … 1079 1080 1080 1081 buf = g_strdup_printf("GET PROFILE PSTN_BALANCE"); 1081 skype_write( ic, buf , strlen( buf ));1082 skype_write( ic, buf ); 1082 1083 g_free(buf); 1083 1084 return(value); … … 1104 1105 1105 1106 buf = g_strdup_printf("CALL %s", nick); 1106 skype_write( ic, buf , strlen( buf ));1107 skype_write( ic, buf ); 1107 1108 g_free(buf); 1108 1109 g_free(nick); … … 1114 1115 { 1115 1116 buf = g_strdup_printf("SET CALL %s STATUS FINISHED", sd->call_id); 1116 skype_write( ic, buf , strlen( buf ));1117 skype_write( ic, buf ); 1117 1118 g_free(buf); 1118 1119 g_free(sd->call_id); … … 1136 1137 *ptr = '\0'; 1137 1138 buf = g_strdup_printf("SET USER %s BUDDYSTATUS 2 Please authorize me\n", nick); 1138 skype_write( ic, buf , strlen( buf ));1139 skype_write( ic, buf ); 1139 1140 g_free(nick); 1140 1141 } … … 1149 1150 *ptr = '\0'; 1150 1151 buf = g_strdup_printf("SET USER %s BUDDYSTATUS 1\n", nick); 1151 skype_write( ic, buf , strlen( buf ));1152 skype_write( ic, buf ); 1152 1153 g_free(nick); 1153 1154 } … … 1158 1159 char *buf; 1159 1160 buf = g_strdup_printf("CHATMESSAGE %s %s\n", gc->title, message); 1160 skype_write( ic, buf , strlen( buf ));1161 skype_write( ic, buf ); 1161 1162 g_free(buf); 1162 1163 } … … 1167 1168 char *buf; 1168 1169 buf = g_strdup_printf("ALTER CHAT %s LEAVE\n", gc->title); 1169 skype_write( ic, buf , strlen( buf ));1170 skype_write( ic, buf ); 1170 1171 g_free(buf); 1171 1172 gc->data = (void*)TRUE; … … 1181 1182 *ptr = '\0'; 1182 1183 buf = g_strdup_printf("ALTER CHAT %s ADDMEMBERS %s\n", gc->title, nick); 1183 skype_write( ic, buf , strlen( buf ));1184 skype_write( ic, buf ); 1184 1185 g_free(buf); 1185 1186 g_free(nick); … … 1192 1193 char *buf; 1193 1194 buf = g_strdup_printf("ALTER CHAT %s SETTOPIC %s\n", gc->title, message); 1194 skype_write( ic, buf , strlen( buf ));1195 skype_write( ic, buf ); 1195 1196 g_free(buf); 1196 1197 sd->topic_wait = 1; … … 1206 1207 *ptr = '\0'; 1207 1208 buf = g_strdup_printf("CHAT CREATE %s\n", nick); 1208 skype_write(ic, buf , strlen(buf));1209 skype_write(ic, buf); 1209 1210 g_free(buf); 1210 1211 sd->groupchat_with = g_strdup(nick); … … 1223 1224 *ptr = '\0'; 1224 1225 buf = g_strdup_printf("GET USER %s FULLNAME\n", nick); 1225 skype_write(ic, buf , strlen(buf));1226 skype_write(ic, buf); 1226 1227 g_free(buf); 1227 1228 buf = g_strdup_printf("GET USER %s PHONE_HOME\n", nick); 1228 skype_write(ic, buf , strlen(buf));1229 skype_write(ic, buf); 1229 1230 g_free(buf); 1230 1231 buf = g_strdup_printf("GET USER %s PHONE_OFFICE\n", nick); 1231 skype_write(ic, buf , strlen(buf));1232 skype_write(ic, buf); 1232 1233 g_free(buf); 1233 1234 buf = g_strdup_printf("GET USER %s PHONE_MOBILE\n", nick); 1234 skype_write(ic, buf , strlen(buf));1235 skype_write(ic, buf); 1235 1236 g_free(buf); 1236 1237 buf = g_strdup_printf("GET USER %s NROF_AUTHED_BUDDIES\n", nick); 1237 skype_write(ic, buf , strlen(buf));1238 skype_write(ic, buf); 1238 1239 g_free(buf); 1239 1240 buf = g_strdup_printf("GET USER %s TIMEZONE\n", nick); 1240 skype_write(ic, buf , strlen(buf));1241 skype_write(ic, buf); 1241 1242 g_free(buf); 1242 1243 buf = g_strdup_printf("GET USER %s LASTONLINETIMESTAMP\n", nick); 1243 skype_write(ic, buf , strlen(buf));1244 skype_write(ic, buf); 1244 1245 g_free(buf); 1245 1246 buf = g_strdup_printf("GET USER %s BIRTHDAY\n", nick); 1246 skype_write(ic, buf , strlen(buf));1247 skype_write(ic, buf); 1247 1248 g_free(buf); 1248 1249 buf = g_strdup_printf("GET USER %s SEX\n", nick); 1249 skype_write(ic, buf , strlen(buf));1250 skype_write(ic, buf); 1250 1251 g_free(buf); 1251 1252 buf = g_strdup_printf("GET USER %s LANGUAGE\n", nick); 1252 skype_write(ic, buf , strlen(buf));1253 skype_write(ic, buf); 1253 1254 g_free(buf); 1254 1255 buf = g_strdup_printf("GET USER %s COUNTRY\n", nick); 1255 skype_write(ic, buf , strlen(buf));1256 skype_write(ic, buf); 1256 1257 g_free(buf); 1257 1258 buf = g_strdup_printf("GET USER %s PROVINCE\n", nick); 1258 skype_write(ic, buf , strlen(buf));1259 skype_write(ic, buf); 1259 1260 g_free(buf); 1260 1261 buf = g_strdup_printf("GET USER %s CITY\n", nick); 1261 skype_write(ic, buf , strlen(buf));1262 skype_write(ic, buf); 1262 1263 g_free(buf); 1263 1264 buf = g_strdup_printf("GET USER %s HOMEPAGE\n", nick); 1264 skype_write(ic, buf , strlen(buf));1265 skype_write(ic, buf); 1265 1266 g_free(buf); 1266 1267 buf = g_strdup_printf("GET USER %s ABOUT\n", nick); 1267 skype_write(ic, buf , strlen(buf));1268 skype_write(ic, buf); 1268 1269 g_free(buf); 1269 1270 }
Note: See TracChangeset
for help on using the changeset viewer.