Mercurial > pidgin
comparison src/protocols/jabber/jabber.c @ 4450:2f225b92a933
[gaim-migrate @ 4725]
sean puts up really long away messages. that reminded me that jabber
doesn't show linebreaks in away messages correctly
I also removed the "gjab_send_raw: \t " lines from the debug window,
because they're useless and annoying.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 28 Jan 2003 18:37:05 +0000 |
parents | 83260179de90 |
children | 2afc0f845e74 |
comparison
equal
deleted
inserted
replaced
4449:faa9b636707a | 4450:2f225b92a933 |
---|---|
96 #define USEROPT_PORT 0 | 96 #define USEROPT_PORT 0 |
97 #define USEROPT_CONN_SERVER 1 | 97 #define USEROPT_CONN_SERVER 1 |
98 | 98 |
99 #define JABBER_TYPING_NOTIFY_INT 15 /* Delay (in seconds) between sending typing notifications */ | 99 #define JABBER_TYPING_NOTIFY_INT 15 /* Delay (in seconds) between sending typing notifications */ |
100 | 100 |
101 #define JABBER_KEEPALIVE_STRING " \t " | |
102 | |
101 /* | 103 /* |
102 * Note: "was_connected" may seem redundant, but it was needed and I | 104 * Note: "was_connected" may seem redundant, but it was needed and I |
103 * didn't want to touch the Jabber state stuff not specific to Gaim. | 105 * didn't want to touch the Jabber state stuff not specific to Gaim. |
104 */ | 106 */ |
105 typedef struct gjconn_struct { | 107 typedef struct gjconn_struct { |
577 if(send(gjc->fd, str, strlen(str), 0) < 0) { | 579 if(send(gjc->fd, str, strlen(str), 0) < 0) { |
578 #endif | 580 #endif |
579 fprintf(stderr, "DBG: Problem sending. Error: %d\n", errno); | 581 fprintf(stderr, "DBG: Problem sending. Error: %d\n", errno); |
580 fflush(stderr); | 582 fflush(stderr); |
581 } | 583 } |
582 debug_printf("gjab_send_raw: %s\n", str); | 584 /* printing keepalives to the debug window is really annoying */ |
585 if(strcmp(str, JABBER_KEEPALIVE_STRING)) | |
586 debug_printf("gjab_send_raw: %s\n", str); | |
583 } | 587 } |
584 } | 588 } |
585 | 589 |
586 static void gjab_reqroster(gjconn gjc) | 590 static void gjab_reqroster(gjconn gjc) |
587 { | 591 { |
3182 ap = str_arr; | 3186 ap = str_arr; |
3183 | 3187 |
3184 for(i=0; i<num_resources; i++) | 3188 for(i=0; i<num_resources; i++) |
3185 { | 3189 { |
3186 jab_res_info jri = resources->data; | 3190 jab_res_info jri = resources->data; |
3191 char *status; | |
3187 realwho = g_strdup_printf("%s/%s", buddy, jri->name); | 3192 realwho = g_strdup_printf("%s/%s", buddy, jri->name); |
3193 status = strdup_withhtml(jabber_lookup_away(gjc, realwho)); | |
3188 *ap++ = g_strdup_printf("<B>Jabber ID:</B> %s<BR>\n", realwho); | 3194 *ap++ = g_strdup_printf("<B>Jabber ID:</B> %s<BR>\n", realwho); |
3189 *ap++ = g_strdup_printf("<B>Status:</B> %s<BR>\n", jabber_lookup_away(gjc, realwho)); | 3195 *ap++ = g_strdup_printf("<B>Status:</B> %s<BR>\n", status); |
3196 g_free(status); | |
3190 g_free(realwho); | 3197 g_free(realwho); |
3191 resources = resources->next; | 3198 resources = resources->next; |
3192 } | 3199 } |
3193 | 3200 |
3194 *ap = NULL; | 3201 *ap = NULL; |
3403 jd->idle = idle ? time(NULL) - idle : idle; | 3410 jd->idle = idle ? time(NULL) - idle : idle; |
3404 } | 3411 } |
3405 | 3412 |
3406 static void jabber_keepalive(struct gaim_connection *gc) { | 3413 static void jabber_keepalive(struct gaim_connection *gc) { |
3407 struct jabber_data *jd = (struct jabber_data *)gc->proto_data; | 3414 struct jabber_data *jd = (struct jabber_data *)gc->proto_data; |
3408 gjab_send_raw(jd->gjc, " \t "); | 3415 gjab_send_raw(jd->gjc, JABBER_KEEPALIVE_STRING); |
3409 } | 3416 } |
3410 | 3417 |
3411 /*---------------------------------------*/ | 3418 /*---------------------------------------*/ |
3412 /* Jabber "set info" (vCard) support */ | 3419 /* Jabber "set info" (vCard) support */ |
3413 /*---------------------------------------*/ | 3420 /*---------------------------------------*/ |
3584 g_free(fmt); | 3591 g_free(fmt); |
3585 } | 3592 } |
3586 } | 3593 } |
3587 } | 3594 } |
3588 | 3595 |
3589 status = jabber_lookup_away(gjc, buddy); | 3596 status = strdup_withhtml(jabber_lookup_away(gjc, buddy)); |
3590 | |
3591 *ap++ = g_strdup_printf("<B>Status:</B> %s<BR>\n", status); | 3597 *ap++ = g_strdup_printf("<B>Status:</B> %s<BR>\n", status); |
3598 g_free(status); | |
3592 | 3599 |
3593 /* | 3600 /* |
3594 * "Description" handled as a special case: get a copy of the | 3601 * "Description" handled as a special case: get a copy of the |
3595 * string and HTML-ize. | 3602 * string and HTML-ize. |
3596 */ | 3603 */ |