changeset 22625:ae436d5e42d5

merge of '7477b26751dbf08e918a1f300fbd2697dd0c6369' and '911e3a3a992368fcb0a43a90238092e27a92c581'
author Etan Reisner <pidgin@unreliablesource.net>
date Fri, 04 Apr 2008 02:45:33 +0000
parents 185b37776140 (current diff) e09650135f04 (diff)
children eccdd341dc6e
files
diffstat 9 files changed, 41 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/buddyicon.c	Thu Apr 03 22:57:58 2008 +0000
+++ b/libpurple/buddyicon.c	Fri Apr 04 02:45:33 2008 +0000
@@ -1,5 +1,5 @@
 /**
- * @file icon.c Buddy Icon API
+ * @file buddyicon.c Buddy Icon API
  * @ingroup core
  */
 
--- a/libpurple/buddyicon.h	Thu Apr 03 22:57:58 2008 +0000
+++ b/libpurple/buddyicon.h	Fri Apr 04 02:45:33 2008 +0000
@@ -45,7 +45,7 @@
 /*@{*/
 
 /**
- * Creates a new buddy icon structure and populate it.
+ * Creates a new buddy icon structure and populates it.
  *
  * If the buddy icon already exists, you'll get a reference to that structure,
  * which will have been updated with the data supplied.
--- a/libpurple/imgstore.c	Thu Apr 03 22:57:58 2008 +0000
+++ b/libpurple/imgstore.c	Fri Apr 04 02:45:33 2008 +0000
@@ -34,11 +34,9 @@
 #include "util.h"
 
 static GHashTable *imgstore;
-static int nextid = 0;
+static unsigned int nextid = 0;
 
-/**
- * Stored image
- *
+/*
  * NOTE: purple_imgstore_add() creates these without zeroing the memory, so
  * NOTE: make sure to update that function when adding members.
  */
@@ -75,7 +73,14 @@
 {
 	PurpleStoredImage *img = purple_imgstore_add(data, size, filename);
 	if (img) {
-		img->id = ++nextid;
+		/*
+		 * Use the next unused id number.  We do it in a loop on the
+		 * off chance that nextid wraps back around to 0 and the hash
+		 * table still contains entries from the first time around.
+		 */
+		do {
+			img->id = ++nextid;
+		} while (img->id == 0 || g_hash_table_lookup(imgstore, &(img->id)) != NULL);
 
 		g_hash_table_insert(imgstore, &(img->id), img);
 	}
--- a/libpurple/imgstore.h	Thu Apr 03 22:57:58 2008 +0000
+++ b/libpurple/imgstore.h	Fri Apr 04 02:45:33 2008 +0000
@@ -51,7 +51,11 @@
  *                      ownership of and free as appropriate.  If you want a
  *                      copy of the data, make it before calling this function.
  * @param size		Image data's size.
- * @param filename	Filename associated with image.
+ * @param filename	Filename associated with image.  This is for your
+ *                  convenience.  It could be the full path to the
+ *                  image or, more commonly, the filename of the image
+ *                  without any directory information.  It can also be
+ *                  NULL, if you don't need to keep track of a filename.
  *
  * @return The stored image.
  */
@@ -69,9 +73,14 @@
  *                      ownership of and free as appropriate.  If you want a
  *                      copy of the data, make it before calling this function.
  * @param size		Image data's size.
- * @param filename	Filename associated with image.
+ * @param filename	Filename associated with image.  This is for your
+ *                  convenience.  It could be the full path to the
+ *                  image or, more commonly, the filename of the image
+ *                  without any directory information.  It can also be
+ *                  NULL, if you don't need to keep track of a filename.
 
- * @return ID for the image.
+ * @return ID for the image.  This is a unique number that can be used
+ *         within libpurple to reference the image.
  */
 int purple_imgstore_add_with_id(gpointer data, size_t size, const char *filename);
 
@@ -116,11 +125,13 @@
 const char *purple_imgstore_get_filename(const PurpleStoredImage *img);
 
 /**
- * Returns an extension corresponding to the image's file type.
+ * Looks at the magic numbers of the image data (the first few bytes)
+ * and returns an extension corresponding to the image's file type.
  *
  * @param img  The image.
  *
- * @return The icon's extension or "icon" if unknown.
+ * @return The image's extension (for example "png") or "icon"
+ *         if unknown.
  */
 const char *purple_imgstore_get_extension(PurpleStoredImage *img);
 
--- a/libpurple/notify.c	Thu Apr 03 22:57:58 2008 +0000
+++ b/libpurple/notify.c	Fri Apr 04 02:45:33 2008 +0000
@@ -586,7 +586,7 @@
 }
 
 
-gchar *
+const gchar *
 purple_notify_user_info_entry_get_label(PurpleNotifyUserInfoEntry *user_info_entry)
 {
 	g_return_val_if_fail(user_info_entry != NULL, NULL);
@@ -603,7 +603,7 @@
 	user_info_entry->label = g_strdup(label);
 }
 
-gchar *
+const gchar *
 purple_notify_user_info_entry_get_value(PurpleNotifyUserInfoEntry *user_info_entry)
 {
 	g_return_val_if_fail(user_info_entry != NULL, NULL);
--- a/libpurple/notify.h	Thu Apr 03 22:57:58 2008 +0000
+++ b/libpurple/notify.h	Fri Apr 04 02:45:33 2008 +0000
@@ -596,7 +596,7 @@
  *
  * @result                    The label
  */
-gchar *purple_notify_user_info_entry_get_label(PurpleNotifyUserInfoEntry *user_info_entry);
+const gchar *purple_notify_user_info_entry_get_label(PurpleNotifyUserInfoEntry *user_info_entry);
 
 /**
  * Set the label for a PurpleNotifyUserInfoEntry
@@ -613,7 +613,7 @@
  *
  * @result                    The value
  */
-gchar *purple_notify_user_info_entry_get_value(PurpleNotifyUserInfoEntry *user_info_entry);
+const gchar *purple_notify_user_info_entry_get_value(PurpleNotifyUserInfoEntry *user_info_entry);
 
 /**
  * Set the value for a PurpleNotifyUserInfoEntry
--- a/libpurple/protocols/jabber/jabber.c	Thu Apr 03 22:57:58 2008 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Fri Apr 04 02:45:33 2008 +0000
@@ -2377,7 +2377,7 @@
 	                  PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
 	                  PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
 	                  jabber_cmd_chat_ban,
-	                  _("ban &lt;user&gt; [room]:  Ban a user from the room."),
+	                  _("ban &lt;user&gt; [reason]:  Ban a user from the room."),
 	                  NULL);
 	purple_cmd_register("affiliate", "ws", PURPLE_CMD_P_PRPL,
 	                  PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
@@ -2401,13 +2401,13 @@
 	                  PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
 	                  PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
 	                  jabber_cmd_chat_join,
-	                  _("join: &lt;room&gt; [server]:  Join a chat on this server."),
+	                  _("join: &lt;room&gt; [password]:  Join a chat on this server."),
 	                  NULL);
 	purple_cmd_register("kick", "ws", PURPLE_CMD_P_PRPL,
 	                  PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
 	                  PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
 	                  jabber_cmd_chat_kick,
-	                  _("kick &lt;user&gt; [room]:  Kick a user from the room."),
+	                  _("kick &lt;user&gt; [reason]:  Kick a user from the room."),
 	                  NULL);
 	purple_cmd_register("msg", "ws", PURPLE_CMD_P_PRPL,
 	                  PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY,
--- a/libpurple/protocols/oscar/family_locate.c	Thu Apr 03 22:57:58 2008 +0000
+++ b/libpurple/protocols/oscar/family_locate.c	Fri Apr 04 02:45:33 2008 +0000
@@ -1354,7 +1354,7 @@
 }
 
 /*
- * Subtype 0x0015 - Request the info a user using the short method.  This is
+ * Subtype 0x0015 - Request the info of a user using the short method.  This is
  * what iChat uses.  It normally is VERY leniently rate limited.
  *
  * @param sn The screen name whose info you wish to request.
--- a/libpurple/protocols/oscar/oscar.c	Thu Apr 03 22:57:58 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Fri Apr 04 02:45:33 2008 +0000
@@ -3629,7 +3629,11 @@
 	if (purple_account_get_user_info(account) != NULL)
 		serv_set_info(gc, purple_account_get_user_info(account));
 
-	if (!od->icq)
+	if (!od->icq && strcmp(purple_account_get_username(account), purple_connection_get_display_name(gc)) != 0)
+		/*
+		 * Format the screen name for AIM accounts if it's different
+		 * than what's currently set.
+		 */
 		oscar_format_screenname(gc, account->username);
 
 	/* Set our available message based on the current status */