comparison src/protocols/jabber/message.c @ 7135:eba5f7be0bc8

[gaim-migrate @ 7702] i think we're allowed to send XHTML to groupchats. if anyone can find a definitive answer about this, lemme know. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 03 Oct 2003 23:14:13 +0000
parents bf630f7dfdcd
children 0e4894b3e2a6
comparison
equal deleted inserted replaced
7134:67f9b43c402a 7135:eba5f7be0bc8
330 { 330 {
331 JabberMessage *jm; 331 JabberMessage *jm;
332 JabberBuddy *jb; 332 JabberBuddy *jb;
333 JabberBuddyResource *jbr; 333 JabberBuddyResource *jbr;
334 char *buf; 334 char *buf;
335 char *xhtml, *plain; 335 char *xhtml;
336 336
337 if(!who || !msg) 337 if(!who || !msg)
338 return 0; 338 return 0;
339 339
340 jb = jabber_buddy_find(gc->proto_data, who, TRUE); 340 jb = jabber_buddy_find(gc->proto_data, who, TRUE);
346 jm->events = JABBER_MESSAGE_EVENT_COMPOSING; 346 jm->events = JABBER_MESSAGE_EVENT_COMPOSING;
347 jm->to = g_strdup(who); 347 jm->to = g_strdup(who);
348 348
349 buf = g_strdup_printf("<html xmlns='http://jabber.org/protocol/xhtml-im'><body>%s</body></html>", msg); 349 buf = g_strdup_printf("<html xmlns='http://jabber.org/protocol/xhtml-im'><body>%s</body></html>", msg);
350 350
351 gaim_markup_html_to_xhtml(buf, &xhtml, &plain); 351 gaim_markup_html_to_xhtml(buf, &xhtml, &jm->body);
352 g_free(buf); 352 g_free(buf);
353 353
354 jm->body = plain;
355 if(!jbr || jbr->capabilities & JABBER_CAP_XHTML) 354 if(!jbr || jbr->capabilities & JABBER_CAP_XHTML)
356 jm->xhtml = xhtml; 355 jm->xhtml = xhtml;
357 else 356 else
358 g_free(xhtml); 357 g_free(xhtml);
359 358
376 jm = g_new0(JabberMessage, 1); 375 jm = g_new0(JabberMessage, 1);
377 jm->js = gc->proto_data; 376 jm->js = gc->proto_data;
378 jm->type = JABBER_MESSAGE_CHAT; 377 jm->type = JABBER_MESSAGE_CHAT;
379 jm->to = g_strdup_printf("%s@%s", chat->room, chat->server); 378 jm->to = g_strdup_printf("%s@%s", chat->room, chat->server);
380 379
381 gaim_markup_html_to_xhtml(message, NULL, &jm->body); 380 gaim_markup_html_to_xhtml(message, &jm->xhtml, &jm->body);
382 381
383 jabber_message_send(jm); 382 jabber_message_send(jm);
384 jabber_message_free(jm); 383 jabber_message_free(jm);
385 return 1; 384 return 1;
386 } 385 }