diff src/protocols/gg/libgg.c @ 9415:1c4092217e4a

[gaim-migrate @ 10230] " Adds support for status messages to Gadu Gadu. Please test Gaim support, as I have only been able to test it using a libgaim-style setting. May not apply cleanly to the plugin info section (callbacks) as I couldn't sync the latest commit there, it's not in anon-CVS yet. Should be easy to fix any conflict that occurs there." --Andrew Wellington please test committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 27 Jun 2004 18:19:09 +0000
parents 6a1f2c444ee7
children 318d14658f95
line wrap: on
line diff
--- a/src/protocols/gg/libgg.c	Sun Jun 27 17:52:05 2004 +0000
+++ b/src/protocols/gg/libgg.c	Sun Jun 27 18:19:09 2004 +0000
@@ -1,4 +1,4 @@
-/* $Id: libgg.c 10064 2004-06-11 03:58:48Z eblanton $ */
+/* $Id: libgg.c 10230 2004-06-27 18:19:09Z lschiere $ */
 
 /*
  *  (C) Copyright 2001 Wojtek Kaniewski <wojtekka@irc.pl>,
@@ -73,7 +73,7 @@
 #ifdef __GNUC__
 __attribute__ ((unused))
 #endif
-= "$Id: libgg.c 10064 2004-06-11 03:58:48Z eblanton $";
+= "$Id: libgg.c 10230 2004-06-27 18:19:09Z lschiere $";
 
 #endif 
 
@@ -592,6 +592,38 @@
 }
 
 /*
+ * gg_change_status_descr()
+ *
+ * zmienia status uøytkownika na opisowy.
+ *
+ *  - sess - opis sesji
+ *  - status - nowy status uøytkownika
+ *  - descr - opis statusu
+ *
+ * 0, -1.
+ */
+int gg_change_status_descr(struct gg_session *sess, int status, const char *descr)
+{
+	struct gg_new_status p;
+
+	gg_debug(GG_DEBUG_FUNCTION, "** gg_change_status_descr(%p, %d, \"%s\");\n", sess, status, descr);
+
+	if (!sess || !descr) {
+		errno = EFAULT;
+		return -1;
+	}
+
+	if (sess->state != GG_STATE_CONNECTED) {
+		errno = ENOTCONN;
+		return -1;
+	}
+
+	p.status = fix32(status);
+
+	return gg_send_packet(sess, GG_NEW_STATUS, &p, sizeof(p), descr, (strlen(descr) > GG_STATUS_DESCR_MAXSIZE) ? GG_STATUS_DESCR_MAXSIZE : strlen(descr), NULL);
+}
+
+/*
  * gg_logoff()
  *
  * wylogowuje użytkownika i zamyka połączenie.