Mercurial > pidgin
annotate plugins/mono/MPlugin.cs @ 13905:4e44ecb866bd
[gaim-migrate @ 16394]
msn_session_sync_users() iterates over the buddy list, following the ->next pointers of the groups, contacts, and buddies. msn_show_sync_issue(), if called, removed the buddy for which it was called, in preparation for the buddy either being added to the server list or confirmed-to-be-removed. This could lead to the buddy pointer being released and ->next therefore being junk.
The buddy is now not removed until the user responds to the action dialog presented via msn_show_sync_issue(). I'm unclear why gtkgaim got away with this exercise in memory stomping but Adium/libgaim crashed every time, but it's safer in any case.
I also changed some foo->bar to gaim_foo_get_bar().
committer: Tailor Script <tailor@pidgin.im>
| author | Evan Schoenberg <evan.s@dreskin.net> |
|---|---|
| date | Sun, 02 Jul 2006 09:37:25 +0000 |
| parents | 67fbd2ff4c4e |
| children |
| rev | line source |
|---|---|
| 11660 | 1 using Gaim; |
| 2 | |
| 3 public class MPlugin : GaimPlugin | |
| 4 { | |
| 5 public void HandleSig(object[] args) | |
| 6 { | |
| 7 Buddy buddy = (Buddy)args[0]; | |
|
11980
67fbd2ff4c4e
[gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
11660
diff
changeset
|
8 Status old_status = (Status)args[1]; |
|
67fbd2ff4c4e
[gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
11660
diff
changeset
|
9 Status status = (Status)args[2]; |
| 11660 | 10 |
|
11980
67fbd2ff4c4e
[gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
11660
diff
changeset
|
11 Debug.debug(Debug.INFO, "mplug", "buddy " + buddy.Name + " went from " + old_status.Id + " to " + status.Id + "\n"); |
| 11660 | 12 } |
| 13 | |
| 14 public override void Load() | |
| 15 { | |
| 16 Debug.debug(Debug.INFO, "mplug", "loading...\n"); | |
| 17 | |
| 18 /*Signal.connect(BuddyList.GetHandle(), this, "buddy-away", new Signal.Handler(HandleSig));*/ | |
|
11980
67fbd2ff4c4e
[gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
11660
diff
changeset
|
19 BuddyList.OnBuddyStatusChanged.connect(this, new Signal.Handler(HandleSig)); |
| 11660 | 20 } |
| 21 | |
| 22 public override void Unload() | |
| 23 { | |
| 24 Debug.debug(Debug.INFO, "mplug", "unloading...\n"); | |
| 25 } | |
| 26 | |
| 27 public override void Destroy() | |
| 28 { | |
| 29 Debug.debug(Debug.INFO, "mplug", "destroying...\n"); | |
| 30 } | |
| 31 | |
| 32 public override GaimPluginInfo Info() | |
| 33 { | |
| 34 return new GaimPluginInfo("C# Plugin", "0.1", "Test C# Plugin", "Longer Description", "Eoin Coffey", "urled"); | |
| 35 } | |
| 36 } |
