Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 465548
Collapse All | Expand All

(-)file_not_specified_in_diff (-8 / +41 lines)
Line  Link Here
0
-- libpurple/protocols/jabber/message.c.orig
0
++ libpurple/protocols/jabber/message.c
Lines 64-70 Link Here
64
	PurpleAccount *account;
64
	PurpleAccount *account;
65
	JabberBuddy *jb;
65
	JabberBuddy *jb;
66
	JabberBuddyResource *jbr;
66
	JabberBuddyResource *jbr;
67
67
	char * msgbody;
68
	
68
	if(!jid)
69
	if(!jid)
69
		return;
70
		return;
70
71
Lines 115-120 Link Here
115
			serv_got_typing_stopped(gc, jm->from);
116
			serv_got_typing_stopped(gc, jm->from);
116
		}
117
		}
117
	} else {
118
	} else {
119
		
118
		if (jid->resource) {
120
		if (jid->resource) {
119
			/*
121
			/*
120
			 * We received a message from a specific resource, so
122
			 * We received a message from a specific resource, so
Lines 156-162 Link Here
156
			jm->body = jabber_google_format_to_html(jm->body);
158
			jm->body = jabber_google_format_to_html(jm->body);
157
			g_free(tmp);
159
			g_free(tmp);
158
		}
160
		}
159
		serv_got_im(gc, jm->from, jm->xhtml ? jm->xhtml : jm->body, 0, jm->sent);
161
162
		msgbody = g_strdup (jm->xhtml ? jm->xhtml : jm->body);
163
		
164
		/* Don't throw away the subject line */
165
		if (jm->subject != NULL) {
166
			char *tmp = msgbody;
167
			msgbody = g_strdup_printf("<b>%s</b><br /> %s", jm->subject, msgbody);
168
			g_free(tmp);
169
		}
170
		
171
		serv_got_im(gc, jm->from, msgbody, 0, jm->sent);
172
		g_free(msgbody);
160
	}
173
	}
161
174
162
	jabber_id_free(jid);
175
	jabber_id_free(jid);
Lines 219-225 Link Here
219
{
232
{
220
	JabberID *jid = jabber_id_new(jm->from);
233
	JabberID *jid = jabber_id_new(jm->from);
221
	JabberChat *chat;
234
	JabberChat *chat;
222
235
	char * msgbody;
236
	
223
	if(!jid)
237
	if(!jid)
224
		return;
238
		return;
225
239
Lines 228-233 Link Here
228
	if(!chat)
242
	if(!chat)
229
		return;
243
		return;
230
244
245
	msgbody = g_strdup (jm->xhtml ? jm->xhtml : jm->body);
246
		
247
	/* Don't throw away the subject line */
248
	if (jm->subject != NULL) {
249
		char *tmp = msgbody;
250
		msgbody = g_strdup_printf("<b>%s</b><br /> %s", jm->subject, msgbody);
251
		g_free(tmp);
252
	}	
253
254
	/* The subject line is not the same as the topic! */
255
	/*
231
	if(jm->subject) {
256
	if(jm->subject) {
232
		purple_conv_chat_set_topic(PURPLE_CONV_CHAT(chat->conv), jid->resource,
257
		purple_conv_chat_set_topic(PURPLE_CONV_CHAT(chat->conv), jid->resource,
233
				jm->subject);
258
				jm->subject);
Lines 244-262 Link Here
244
			g_free(tmp2);
269
			g_free(tmp2);
245
			g_free(msg);
270
			g_free(msg);
246
		}
271
		}
247
	}
272
	} */
248
273
249
	if(jm->xhtml || jm->body) {
274
	if(jm->xhtml || jm->body) {
250
		if(jid->resource)
275
		if(jid->resource)
251
			serv_got_chat_in(jm->js->gc, chat->id, jid->resource,
276
			serv_got_chat_in(jm->js->gc, chat->id, jid->resource,
252
							jm->delayed ? PURPLE_MESSAGE_DELAYED : 0,
277
							jm->delayed ? PURPLE_MESSAGE_DELAYED : 0,
253
							jm->xhtml ? jm->xhtml : jm->body, jm->sent);
278
							msgbody, jm->sent);
254
		else if(chat->muc)
279
		else if(chat->muc)
255
			purple_conv_chat_write(PURPLE_CONV_CHAT(chat->conv), "",
280
			purple_conv_chat_write(PURPLE_CONV_CHAT(chat->conv), "",
256
							jm->xhtml ? jm->xhtml : jm->body,
281
							msgbody,
257
							PURPLE_MESSAGE_SYSTEM, jm->sent);
282
							PURPLE_MESSAGE_SYSTEM, jm->sent);
258
	}
283
	}
259
284
285
	g_free(msgbody);
260
	jabber_id_free(jid);
286
	jabber_id_free(jid);
261
}
287
}
262
288
Lines 282-287 Link Here
282
static void handle_error(JabberMessage *jm)
308
static void handle_error(JabberMessage *jm)
283
{
309
{
284
	char *buf;
310
	char *buf;
311
 	char *msgbody;
285
312
286
	if(!jm->body)
313
	if(!jm->body)
287
		return;
314
		return;
Lines 289-298 Link Here
289
	buf = g_strdup_printf(_("Message delivery to %s failed: %s"),
316
	buf = g_strdup_printf(_("Message delivery to %s failed: %s"),
290
			jm->from, jm->error ? jm->error : "");
317
			jm->from, jm->error ? jm->error : "");
291
318
319
	msgbody = (! jm->subject ) ?
320
		  g_strdup(jm->xhtml ? jm->xhtml : jm->body)
321
		: g_strdup_printf("<b>%s</b><br /> %s",
322
			jm->subject, jm->xhtml ? jm->xhtml : jm->body);
323
292
	purple_notify_formatted(jm->js->gc, _("XMPP Message Error"), _("XMPP Message Error"), buf,
324
	purple_notify_formatted(jm->js->gc, _("XMPP Message Error"), _("XMPP Message Error"), buf,
293
			jm->xhtml ? jm->xhtml : jm->body, NULL, NULL);
325
			msgbody, NULL, NULL);
294
326
295
	g_free(buf);
327
	g_free(buf);
328
	g_free(msgbody);
296
}
329
}
297
330
298
static void handle_buzz(JabberMessage *jm) {
331
static void handle_buzz(JabberMessage *jm) {

Return to bug 465548