Mercurial > pidgin
comparison src/protocols/oscar/oscar.c @ 2336:c6c5eaf69188
[gaim-migrate @ 2349]
hi van
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 21 Sep 2001 00:57:13 +0000 |
parents | 7ec21662ffc2 |
children | 19ea44f74a88 |
comparison
equal
deleted
inserted
replaced
2335:2c595fc5f1f8 | 2336:c6c5eaf69188 |
---|---|
1300 ir->length = args->iconlen; | 1300 ir->length = args->iconlen; |
1301 ir->checksum = args->iconsum; | 1301 ir->checksum = args->iconsum; |
1302 ir->timestamp = args->iconstamp; | 1302 ir->timestamp = args->iconstamp; |
1303 } | 1303 } |
1304 | 1304 |
1305 if (gc->user->iconfile && (args->icbmflags & AIM_IMFLAGS_BUDDYREQ)) { | 1305 if (gc->user->iconfile[0] && (args->icbmflags & AIM_IMFLAGS_BUDDYREQ)) { |
1306 FILE *file; | 1306 FILE *file; |
1307 struct stat st; | 1307 struct stat st; |
1308 | 1308 |
1309 if (!stat(gc->user->iconfile, &st)) { | 1309 if (!stat(gc->user->iconfile, &st)) { |
1310 char *buf = g_malloc(st.st_size); | 1310 char *buf = g_malloc(st.st_size); |
1311 file = fopen(gc->user->iconfile, "r"); | 1311 file = fopen(gc->user->iconfile, "r"); |
1312 if (file) { | 1312 if (file) { |
1313 fread(buf, 1, st.st_size, file); | 1313 fread(buf, 1, st.st_size, file); |
1314 debug_printf("Sending buddy icon to %d\n", userinfo->sn); | |
1314 aim_send_icon(sess, conn, userinfo->sn, buf, st.st_size, | 1315 aim_send_icon(sess, conn, userinfo->sn, buf, st.st_size, |
1315 st.st_mtime, aim_iconsum(buf, st.st_size)); | 1316 st.st_mtime, aim_iconsum(buf, st.st_size)); |
1316 fclose(file); | 1317 fclose(file); |
1317 } | 1318 } else |
1319 debug_printf("Can't open buddy icon file!\n"); | |
1318 g_free(buf); | 1320 g_free(buf); |
1319 } | 1321 } else |
1322 debug_printf("Can't stat buddy icon file!\n"); | |
1320 } | 1323 } |
1321 | 1324 |
1322 /* | 1325 /* |
1323 * Quickly convert it to eight bit format, replacing | 1326 * Quickly convert it to eight bit format, replacing |
1324 * non-ASCII UNICODE characters with their equivelent | 1327 * non-ASCII UNICODE characters with their equivelent |
2109 ir->request = FALSE; | 2112 ir->request = FALSE; |
2110 args.flags |= AIM_IMFLAGS_BUDDYREQ; | 2113 args.flags |= AIM_IMFLAGS_BUDDYREQ; |
2111 debug_printf("sending buddy icon request with message\n"); | 2114 debug_printf("sending buddy icon request with message\n"); |
2112 } | 2115 } |
2113 | 2116 |
2114 if (gc->user->iconfile && !stat(gc->user->iconfile, &st)) { | 2117 if (gc->user->iconfile[0] && !stat(gc->user->iconfile, &st)) { |
2115 FILE *file = fopen(gc->user->iconfile, "r"); | 2118 FILE *file = fopen(gc->user->iconfile, "r"); |
2116 if (file) { | 2119 if (file) { |
2117 char *buf = g_malloc(st.st_size); | 2120 char *buf = g_malloc(st.st_size); |
2118 fread(buf, 1, st.st_size, file); | 2121 fread(buf, 1, st.st_size, file); |
2119 | 2122 |
2120 args.iconlen = st.st_size; | 2123 args.iconlen = st.st_size; |
2121 args.iconsum = aim_iconsum(buf, st.st_size); | 2124 args.iconsum = aim_iconsum(buf, st.st_size); |
2122 args.iconstamp = st.st_mtime; | 2125 args.iconstamp = st.st_mtime; |
2123 | 2126 |
2124 args.flags |= AIM_IMFLAGS_HASICON; | 2127 args.flags |= AIM_IMFLAGS_HASICON; |
2128 debug_printf("Claiming to have an icon.\n"); | |
2125 | 2129 |
2126 fclose(file); | 2130 fclose(file); |
2127 g_free(buf); | 2131 g_free(buf); |
2128 } | 2132 } |
2129 } | 2133 } |