[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.31,1.32
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.31,1.32 |
Date: |
Wed, 15 Jan 2003 12:46:29 -0500 |
Update of /cvsroot/ayttm/ayttm/modules/msn2
In directory subversions:/tmp/cvs-serv29296/modules/msn2
Modified Files:
msn.C
Log Message:
Fix contact moving between groups
when group didn't exist on server
Index: msn.C
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/msn2/msn.C,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- msn.C 15 Jan 2003 14:04:47 -0000 1.31
+++ msn.C 15 Jan 2003 17:46:26 -0000 1.32
@@ -1259,9 +1259,16 @@
add_group(eb_name);
}
-static int finish_group_move(value_pair *tomove);
+typedef struct _movecb_data
+{
+ char oldgr[255];
+ char newgr[255];
+ char handle[255];
+} movecb_data;
-void eb_msn_change_group(eb_account * ea, gchar *new_group)
+static int finish_group_move(movecb_data *tomove);
+
+void eb_msn_real_change_group(eb_account * ea, gchar *old_group, gchar
*new_group)
{
char *oldid = NULL, *newid = NULL;
char *int_new_group = NULL, *int_old_group;
@@ -1269,43 +1276,49 @@
int_new_group = "~";
else
int_new_group = new_group;
- if (!strcmp(_("Buddies"), ea->account_contact->group->name))
+ if (!strcmp(_("Buddies"), old_group))
int_old_group = "~";
else
- int_old_group = ea->account_contact->group->name;
+ int_old_group = old_group;
if (!mainconn || listsyncing) /* not now */
return;
eb_debug(DBG_MOD,"moving %s from %s to %s\n", ea->handle,
int_old_group, int_new_group);
oldid = value_pair_get_value(msn_grouplist, int_old_group);
newid = value_pair_get_value(msn_grouplist, int_new_group);
if (newid == NULL || !strcmp("-1",newid)) {
- value_pair *tomove = g_new0(value_pair, 1);
+ movecb_data *tomove = g_new0(movecb_data, 1);
if (newid == NULL) {
msn_add_group(mainconn, int_new_group);
ext_got_group("-1",int_new_group);
}
- strcpy(tomove->key, ea->handle);
- strcpy(tomove->value, int_new_group);
+ strcpy(tomove->handle, ea->handle);
+ strcpy(tomove->newgr, int_new_group);
+ strcpy(tomove->oldgr, int_old_group);
gtk_timeout_add(1000, (GtkFunction)finish_group_move,
(gpointer)tomove);
return;
}
msn_change_group(mainconn, ea->handle, oldid, newid);
}
+void eb_msn_change_group(eb_account * ea, gchar *new_group)
+{
+ eb_msn_real_change_group(ea,ea->account_contact->group->name,
new_group);
+}
-static int finish_group_move(value_pair *tomove)
+static int finish_group_move(movecb_data *tomove)
{
- char *group = tomove->value;
- char *handle = tomove->key;
+ char *ngroup = tomove->newgr;
+ char *ogroup = tomove->oldgr;
+ char *handle = tomove->handle;
eb_account *ea = find_account_by_handle(handle,
SERVICE_INFO.protocol_id);
- if (ea && group) {
- char *id = value_pair_get_value(msn_grouplist, group);
+ if (ea && ogroup && ngroup) {
+ char *id = value_pair_get_value(msn_grouplist, ngroup);
if (id == NULL || !strcmp(id,"-1")) {
eb_debug(DBG_MOD,"ID still %s\n",id);
return TRUE;
}
eb_debug(DBG_MOD,"Got ID %s\n",id);
- eb_msn_change_group(ea,group);
+ eb_msn_real_change_group(ea,ogroup,ngroup);
return FALSE;
}
return TRUE;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.31,1.32,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm/src chat_room.c,1.27,1.28
- Next by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.124,1.125 configure.in,1.121,1.122
- Previous by thread:
[Ayttm-commits] CVS: ayttm/src chat_room.c,1.27,1.28
- Next by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.124,1.125 configure.in,1.121,1.122
- Index(es):