diff src/protocols/jabber/chat.c @ 7972:ac01b7d67ff9

[gaim-migrate @ 8649] yay, /nick for jabber i'll be really happy if marv finishes /command support for the core soon ;-) committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 02 Jan 2004 07:34:26 +0000
parents 6fca0d9cc98b
children 415df6fa0395
line wrap: on
line diff
--- a/src/protocols/jabber/chat.c	Fri Jan 02 06:16:44 2004 +0000
+++ b/src/protocols/jabber/chat.c	Fri Jan 02 07:34:26 2004 +0000
@@ -571,3 +571,25 @@
 }
 
 
+void jabber_chat_change_nick(JabberChat *chat, const char *nick)
+{
+	xmlnode *presence;
+	char *full_jid;
+
+	if(!chat->muc) {
+		gaim_conv_chat_write(GAIM_CONV_CHAT(chat->conv), "",
+				_("Nick changing not supported in non-MUC chatrooms"),
+				GAIM_MESSAGE_SYSTEM, time(NULL));
+		return;
+	}
+
+	presence = jabber_presence_create(chat->js->gc->away_state, chat->js->gc->away);
+	full_jid = g_strdup_printf("%s@%s/%s", chat->room, chat->server, nick);
+	xmlnode_set_attrib(presence, "to", full_jid);
+	g_free(full_jid);
+
+	jabber_send(chat->js, presence);
+	xmlnode_free(presence);
+}
+
+