[Fwd: Revision 39a052121895af9c21604e2be85acd0f657a4f28]

Phil Hannent phil at hannent.co.uk
Tue Jul 31 07:19:52 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

And people thought MSN nudge was bad!

I am wholly thankful I don't have a myspace account.

;-)

Phil

PS I have been very impressed with the SoC commits, hats off to you all.


- -------- Original Message --------
Subject: Revision 39a052121895af9c21604e2be85acd0f657a4f28
Date: Mon, 30 Jul 2007 23:03:50 -0400 (EDT)
From: jeff2 at soc.pidgin.im
Reply-To: devel at pidgin.im
To: commits at pidgin.im

- -----------------------------------------------------------------
Revision: 39a052121895af9c21604e2be85acd0f657a4f28
Ancestor: 0c554819c517bd017bccf06a9c1c29bc6447555c
Author: jeff2 at soc.pidgin.im
Date: 2007-07-21T05:57:27
Branch: im.pidgin.soc.2007.msimprpl

Modified files:
        libpurple/protocols/myspace/myspace.c
        libpurple/protocols/myspace/myspace.h

ChangeLog:

Support incoming zaps.


============================================================
- --- libpurple/protocols/myspace/myspace.c	a67b84f71181693a7f3858091973fd1768345605
+++ libpurple/protocols/myspace/myspace.c	b5a926e85beb7acd413362e9ec9563eb9ca2df62
@@ -1298,6 +1298,53 @@ msim_unrecognized(MsimSession *session,
     }
 }

+/** Process an incoming zap. */
+gboolean
+msim_incoming_zap(MsimSession *session, MsimMessage *msg)
+{
+    gchar *msg_text, *username, *zap_text;
+    gint zap;
+    /* Names from official client dropdown menu. */
+    static const gchar *zap_names[] =
+    {
+        "zap", "whack", "torch", "smooch", "hug", "bslap", "goose",
+        "hi-five", "punk'd", "raspberry"
+    };
+    const gchar *zap_past_tense[sizeof(zap_names) / sizeof(zap_names[0])];
+
+    zap_past_tense[0] = _("zapped");
+    zap_past_tense[1] = _("whacked");
+    zap_past_tense[2] = _("torched");
+    zap_past_tense[3] = _("smooched");
+    zap_past_tense[4] = _("hugged");
+    zap_past_tense[5] = _("bslapped");
+    zap_past_tense[6] = _("goosed");
+    zap_past_tense[7] = _("hi-fived");
+    zap_past_tense[8] = _("punk'd");
+    zap_past_tense[9] = _("raspberried");
+
+    msg_text = msim_msg_get_string(msg, "msg");
+    username = msim_msg_get_string(msg, "_username");
+
+    g_return_val_if_fail(msg_text != NULL, FALSE);
+    g_return_val_if_fail(username != NULL, FALSE);
+
+    g_return_val_if_fail(sscanf(msg_text, "!!!ZAP_SEND!!!=RTE_BTN_ZAPS_%d",
&zap) == 1, FALSE);
+
+    zap = CLAMP(zap, 0, sizeof(zap_past_tense) / sizeof(zap_past_tense[0]));
+
+    zap_text = g_strdup_printf(_("You have been %s!"), zap_past_tense[zap]);

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFGrxrXIdVDbqU9AOQRCoJeAKCIrvPImJ0Ceo5u8jl8Y5jh9Qe+awCfcup+
IgHtG0AmVRx5Tpl1GMRtvHA=
=EbMk
-----END PGP SIGNATURE-----




More information about the Devel mailing list