List Info

Thread: Group is not tracked when adding a buddy in Sametime




Group is not tracked when adding a buddy in Sametime
user name
2006-07-17 05:10:29
hi, guys,

The problem is that when you add a buddy in Sametime, you
choose
the group to add the buddy into in the first dialog, and if
you
get ambiguous dialog, you choose the one you wanna add, then
click "Add", in the second "Add Buddy
Dialog", the group is not
the same as the one previously selected.

IMHO this is inconvenient for user, becuase he has to select
the 
appropriate group again. So the group should be tracked.

The patch is attached. Any comments are appreciated.

-- 
A. Because it makes the logic of the discussion difficult to
follow.
Q. Why shoudn't I top post?
A. No.
Q Should I top post?

A: Because it destroys the flow of the conversation
Q: Why is it bad?
A: No, it's bad.
Q: Should I top post in replies to mailing lists? 
Index: sametime.c
============================================================
=======
--- sametime.c	(revision 16497)
+++ sametime.c	(working copy)
 -234,6
+234,11 
 };
 
 
+typedef struct {
+    GaimBuddy *buddy;
+    GaimGroup *group;
+} BuddyAddData;
+
 /* blist and aware functions */
 
 static void blist_export(GaimConnection *gc, struct
mwSametimeList *stlist);
 -4235,19
+4240,21 
 
 
 static void notify_add(GaimConnection *gc, GList *row, void
*user_data) {
+  BuddyAddData *data = user_data;
  
gaim_blist_request_add_buddy(gaim_connection_get_account(gc)
,
-			       g_list_nth_data(row, 1), NULL,
+			       g_list_nth_data(row, 1), data->group->name,
 			       g_list_nth_data(row, 0));
 }
 
 
 static void notify_close(gpointer data) {
+  g_free(data);
   ;
 }
 
 
 static void multi_resolved_query(struct mwResolveResult
*result,
-				 GaimConnection *gc) {
+				 GaimConnection *gc, gpointer data) {
   GList *l;
   const char *msgA;
   const char *msgB;
 -4292,7
+4299,7 
   msg = g_strdup_printf(msgB, result->name);
 
   gaim_notify_searchresults(gc, _("Select
User"),
-			    msgA, msg, sres, notify_close, NULL);
+			    msgA, msg, sres, notify_close, data);
 
   g_free(msg);
 }
 -4303,10
+4310,13 
 			       gpointer b) {
 
   struct mwResolveResult *res = NULL;
-  GaimBuddy *buddy = b;
+  BuddyAddData *data = b;
+  GaimBuddy *buddy = NULL;
   GaimConnection *gc;
   struct mwGaimPluginData *pd;
 
+  buddy = data->buddy;
+
   gc = gaim_account_get_connection(buddy->account);
   pd = gc->proto_data;
 
 -4323,7
+4333,7 
 	   term, better safe then sorry, so let's make sure it's
who
 	   the user meant to add */
 	gaim_blist_remove_buddy(buddy);
-	multi_resolved_query(res, gc);
+	multi_resolved_query(res, gc, data);
 	
       } else {
 
 -4341,7
+4351,7 
     } else {
       /* prompt user if more than one match was returned */
       gaim_blist_remove_buddy(buddy);
-      multi_resolved_query(res, gc);
+      multi_resolved_query(res, gc, data);
     }
     
     return;
 -4385,6
+4395,12 
   enum mwResolveFlag flags;
   guint32 req;
 
+  BuddyAddData *data;
+
+  data = g_new0(BuddyAddData, 1);
+  data->buddy = buddy;
+  data->group = group;
+
   pd = gc->proto_data;
   srvc = pd->srvc_resolve;
 
 -4398,7
+4414,7 
   flags = mwResolveFlag_FIRST | mwResolveFlag_USERS;
 
   req = mwServiceResolve_resolve(srvc, query, flags,
add_buddy_resolved,
-				 buddy, NULL);
+				 data, NULL);
   g_list_free(query);
 
   if(req == SEARCH_ERROR) {

------------------------------------------------------------
-------------
Using Tomcat but need to do more? Need to support web
services, security?
Get stuff done quickly with pre-integrated technology to
make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on
Apache Geronimo
http://sel.as-us.falkag.net/
sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Gaim-devel mailing list
Gaim-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gaim-devel
Group is not tracked when adding a buddy in Sametime
user name
2006-07-17 06:18:36
Hi, SuperMMX <SuperMMXgmail.com> :

On Mon, 17 Jul 2006 13:10:29 +0800
SuperMMX <SuperMMXgmail.com> wrote:

> 
> hi, guys,
> 
> The problem is that when you add a buddy in Sametime,
you choose
> the group to add the buddy into in the first dialog,
and if you
> get ambiguous dialog, you choose the one you wanna add,
then
> click "Add", in the second "Add Buddy
Dialog", the group is not
> the same as the one previously selected.
> 
> IMHO this is inconvenient for user, becuase he has to
select the 
> appropriate group again. So the group should be
tracked.
> 
> The patch is attached. Any comments are appreciated.
> 

The patch breaks the search action, this new patch add more
error checking to avoid crashing.

-- 
A. Because it makes the logic of the discussion difficult to
follow.
Q. Why shoudn't I top post?
A. No.
Q Should I top post?

A: Because it destroys the flow of the conversation
Q: Why is it bad?
A: No, it's bad.
Q: Should I top post in replies to mailing lists? 
Index: sametime.c
============================================================
=======
--- sametime.c	(revision 16497)
+++ sametime.c	(working copy)
 -234,6
+234,11 
 };
 
 
+typedef struct {
+    GaimBuddy *buddy;
+    GaimGroup *group;
+} BuddyAddData;
+
 /* blist and aware functions */
 
 static void blist_export(GaimConnection *gc, struct
mwSametimeList *stlist);
 -4235,19
+4240,27 
 
 
 static void notify_add(GaimConnection *gc, GList *row, void
*user_data) {
+  BuddyAddData *data = user_data;
+  char *group_name = NULL;
+
+  if (data && data->group) {
+      group_name = data->group->name;
+  }
  
gaim_blist_request_add_buddy(gaim_connection_get_account(gc)
,
-			       g_list_nth_data(row, 1), NULL,
+			       g_list_nth_data(row, 1), group_name,
 			       g_list_nth_data(row, 0));
 }
 
 
 static void notify_close(gpointer data) {
-  ;
+    if (data) {
+        g_free(data);
+    }
 }
 
 
 static void multi_resolved_query(struct mwResolveResult
*result,
-				 GaimConnection *gc) {
+				 GaimConnection *gc, gpointer data) {
   GList *l;
   const char *msgA;
   const char *msgB;
 -4292,7
+4305,7 
   msg = g_strdup_printf(msgB, result->name);
 
   gaim_notify_searchresults(gc, _("Select
User"),
-			    msgA, msg, sres, notify_close, NULL);
+			    msgA, msg, sres, notify_close, data);
 
   g_free(msg);
 }
 -4303,10
+4316,15 
 			       gpointer b) {
 
   struct mwResolveResult *res = NULL;
-  GaimBuddy *buddy = b;
+  BuddyAddData *data = b;
+  GaimBuddy *buddy = NULL;
   GaimConnection *gc;
   struct mwGaimPluginData *pd;
 
+  if (data) {
+      buddy = data->buddy;
+  }
+
   gc = gaim_account_get_connection(buddy->account);
   pd = gc->proto_data;
 
 -4323,7
+4341,7 
 	   term, better safe then sorry, so let's make sure it's
who
 	   the user meant to add */
 	gaim_blist_remove_buddy(buddy);
-	multi_resolved_query(res, gc);
+	multi_resolved_query(res, gc, data);
 	
       } else {
 
 -4341,7
+4359,7 
     } else {
       /* prompt user if more than one match was returned */
       gaim_blist_remove_buddy(buddy);
-      multi_resolved_query(res, gc);
+      multi_resolved_query(res, gc, data);
     }
     
     return;
 -4385,6
+4403,12 
   enum mwResolveFlag flags;
   guint32 req;
 
+  BuddyAddData *data;
+
+  data = g_new0(BuddyAddData, 1);
+  data->buddy = buddy;
+  data->group = group;
+
   pd = gc->proto_data;
   srvc = pd->srvc_resolve;
 
 -4398,7
+4422,7 
   flags = mwResolveFlag_FIRST | mwResolveFlag_USERS;
 
   req = mwServiceResolve_resolve(srvc, query, flags,
add_buddy_resolved,
-				 buddy, NULL);
+				 data, NULL);
   g_list_free(query);
 
   if(req == SEARCH_ERROR) {

------------------------------------------------------------
-------------
Using Tomcat but need to do more? Need to support web
services, security?
Get stuff done quickly with pre-integrated technology to
make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on
Apache Geronimo
http://sel.as-us.falkag.net/
sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Gaim-devel mailing list
Gaim-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gaim-devel
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )