fix-casts.sh

Tue, 18 Aug 2009 22:35:34 +0000

author
Mark Doliner <markdoliner@pidgin.im>
date
Tue, 18 Aug 2009 22:35:34 +0000
changeset 28237
231abd732132
parent 24975
7abe1341dc45
permissions
-rwxr-xr-x

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

24973
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
1 #!/bin/sh
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
2
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
3 if [ $# -eq 0 ]; then
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
4 echo "Usage: `basename "$0"` PurpleFoo..."
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
5 echo
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
6 echo "This script searches the *current working directory* and replaces casts"
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
7 echo "with GObject-style type checking and casting macros."
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
8 echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".'
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
9 exit 0
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
10 fi
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
11
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
12 for struct in $* ; do
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
13 cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"`
24975
7abe1341dc45 Minor fixes to the cast changing script.
Richard Laager <rlaager@pidgin.im>
parents: 24973
diff changeset
14 for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do
7abe1341dc45 Minor fixes to the cast changing script.
Richard Laager <rlaager@pidgin.im>
parents: 24973
diff changeset
15 sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file
7abe1341dc45 Minor fixes to the cast changing script.
Richard Laager <rlaager@pidgin.im>
parents: 24973
diff changeset
16 sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file
24973
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
17 done
d021d316a53d Add a script to change casts to GObject macros. We'll run this later.
Richard Laager <rlaager@pidgin.im>
parents:
diff changeset
18 done

mercurial