view fix-casts.sh @ 28345:de7bbdcb695b

Stop attempting to fetch oscar buddy info automatically for people on our buddy list. tmm1 (Aman Gupta) correct pointed out that the only thing we need this for is to show users' status messages in the buddy list, and new AIM clients have been putting the status message in the userinfo block which is sent as part of the presence. So we can eliminate a lot of code. We now grab screen name formatting when we get the initial presence for buddies rather than when we get the auto-fetched info And the "message" stored in the buddy's PurpleStatus will now be plaintext even when the away message contains HTML. This is because the status message from the userinfo block is always plaintext. This doesn't cause problems for any UIs that I'm aware of, but let me know if it undesirable for you. Fixes #9843
author Mark Doliner <mark@kingant.net>
date Tue, 18 Aug 2009 22:35:34 +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