view fix-casts.sh @ 31849:4c046f6564cd

Change the heuristic we use for setting od->icq. We used to set it to true any time the username contained only digits. Now we set it to try if account->protocol_id is prpl-icq. This means we're now relying on the user to tell us whether their account is AIM or ICQ... and I think that's fine. The reason for this change is that we/AOL apparently allow the user to login to ICQ accounts by entering their email address. This means we're no longer able to look at the username to determine whether it's an AIM name or an ICQ name. This was a problem because we were trying to format the spacing/capitalization in the username if the name was an icq email address, which resulted in an annoying popup error at login. Fixes #13883. It's probably safe for this to go into im.pidgin.pidgin (maybe after the pending release), but I really don't want to keep changing the 2.x.y branch. I think we need to move on to 3.x.y.
author Mark Doliner <mark@kingant.net>
date Mon, 09 May 2011 04:42:52 +0000
parents c3ca613ab550
children
line wrap: on
line source

#!/bin/sh

if [ $# -eq 0 ]; then
	echo "Usage: `basename "$0"` PurpleFoo..."
	echo
	echo "This script searches the *current working directory* and replaces casts"
	echo "with GObject-style type checking and casting macros."
	echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".'
	exit 0
fi

for struct in $* ; do
	cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"`
	for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do
		sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file
		sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file
	done
done