libpurple/protocols/gg/lib/events.c

changeset 31294
73607ab89c6f
parent 31183
0afcbe3be8e9
child 31609
d67fbc90b28a
equal deleted inserted replaced
31293:169eeb43b52c 31294:73607ab89c6f
252 } 252 }
253 } 253 }
254 254
255 /** 255 /**
256 * \internal Analizuje informacje rozszerzone wiadomości. 256 * \internal Analizuje informacje rozszerzone wiadomości.
257 * 257 *
258 * \param sess Struktura sesji. 258 * \param sess Struktura sesji.
259 * \param e Struktura zdarzenia. 259 * \param e Struktura zdarzenia.
260 * \param sender Numer nadawcy. 260 * \param sender Numer nadawcy.
261 * \param p Wskaźnik na dane rozszerzone. 261 * \param p Wskaźnik na dane rozszerzone.
262 * \param packet_end Wskaźnik na koniec pakietu. 262 * \param packet_end Wskaźnik na koniec pakietu.
565 len++; 565 len++;
566 } 566 }
567 567
568 if (dst != NULL) 568 if (dst != NULL)
569 dst[len] = 0; 569 dst[len] = 0;
570 570
571 return len; 571 return len;
572 } 572 }
573 573
574 /** 574 /**
575 * \internal Analizuje przychodzący pakiet z wiadomością protokołu Gadu-Gadu 8.0. 575 * \internal Analizuje przychodzący pakiet z wiadomością protokołu Gadu-Gadu 8.0.
891 } 891 }
892 892
893 e->event.notify60[i].descr = descr; 893 e->event.notify60[i].descr = descr;
894 894
895 /* XXX czas */ 895 /* XXX czas */
896 896
897 length -= sizeof(struct gg_notify_reply77) + descr_len + 1; 897 length -= sizeof(struct gg_notify_reply77) + descr_len + 1;
898 n = (void*) ((char*) n + sizeof(struct gg_notify_reply77) + descr_len + 1); 898 n = (void*) ((char*) n + sizeof(struct gg_notify_reply77) + descr_len + 1);
899 } else { 899 } else {
900 length = 0; 900 length = 0;
901 } 901 }
1024 1024
1025 memcpy(e->event.notify60[i].descr, (char*) n + sizeof(struct gg_notify_reply60) + 1, descr_len); 1025 memcpy(e->event.notify60[i].descr, (char*) n + sizeof(struct gg_notify_reply60) + 1, descr_len);
1026 e->event.notify60[i].descr[descr_len] = 0; 1026 e->event.notify60[i].descr[descr_len] = 0;
1027 1027
1028 /* XXX czas */ 1028 /* XXX czas */
1029 1029
1030 length -= sizeof(struct gg_notify_reply60) + descr_len + 1; 1030 length -= sizeof(struct gg_notify_reply60) + descr_len + 1;
1031 n = (void*) ((char*) n + sizeof(struct gg_notify_reply60) + descr_len + 1); 1031 n = (void*) ((char*) n + sizeof(struct gg_notify_reply60) + descr_len + 1);
1032 } else { 1032 } else {
1033 length = 0; 1033 length = 0;
1034 } 1034 }
2075 if (sess->protocol_version >= 0x2e) { 2075 if (sess->protocol_version >= 0x2e) {
2076 struct gg_login80 l; 2076 struct gg_login80 l;
2077 2077
2078 uint32_t tmp_version_len = gg_fix32(strlen(GG8_VERSION)); 2078 uint32_t tmp_version_len = gg_fix32(strlen(GG8_VERSION));
2079 uint32_t tmp_descr_len = gg_fix32((sess->initial_descr) ? strlen(sess->initial_descr) : 0); 2079 uint32_t tmp_descr_len = gg_fix32((sess->initial_descr) ? strlen(sess->initial_descr) : 0);
2080 2080
2081 memset(&l, 0, sizeof(l)); 2081 memset(&l, 0, sizeof(l));
2082 l.uin = gg_fix32(sess->uin); 2082 l.uin = gg_fix32(sess->uin);
2083 memcpy(l.language, GG8_LANG, sizeof(l.language)); 2083 memcpy(l.language, GG8_LANG, sizeof(l.language));
2084 l.hash_type = sess->hash_type; 2084 l.hash_type = sess->hash_type;
2085 memcpy(l.hash, login_hash, sizeof(login_hash)); 2085 memcpy(l.hash, login_hash, sizeof(login_hash));
2088 l.features = gg_fix32(sess->protocol_features); 2088 l.features = gg_fix32(sess->protocol_features);
2089 l.image_size = sess->image_size; 2089 l.image_size = sess->image_size;
2090 l.dunno2 = 0x64; 2090 l.dunno2 = 0x64;
2091 2091
2092 gg_debug_session(sess, GG_DEBUG_TRAFFIC, "// gg_watch_fd() sending GG_LOGIN80 packet\n"); 2092 gg_debug_session(sess, GG_DEBUG_TRAFFIC, "// gg_watch_fd() sending GG_LOGIN80 packet\n");
2093 ret = gg_send_packet(sess, GG_LOGIN80, 2093 ret = gg_send_packet(sess, GG_LOGIN80,
2094 &l, sizeof(l), 2094 &l, sizeof(l),
2095 &tmp_version_len, sizeof(uint32_t), GG8_VERSION, strlen(GG8_VERSION), 2095 &tmp_version_len, sizeof(uint32_t), GG8_VERSION, strlen(GG8_VERSION),
2096 &tmp_descr_len, sizeof(uint32_t), sess->initial_descr, (sess->initial_descr) ? strlen(sess->initial_descr) : 0, 2096 &tmp_descr_len, sizeof(uint32_t), sess->initial_descr, (sess->initial_descr) ? strlen(sess->initial_descr) : 0,
2097 NULL); 2097 NULL);
2098 2098
2099 } else if (sess->protocol_version == 0x2d) { 2099 } else if (sess->protocol_version == 0x2d) {

mercurial