[siesta-commit] siesta/lib/Siesta List.pm,1.14,1.15

[prev] [thread] [next] [lurker] [Date index for 2002/08/23]

From: gmccarroll
Subject: [siesta-commit] siesta/lib/Siesta List.pm,1.14,1.15
Date: 10:22 on 23 Aug 2002
Update of /cvsroot/siesta/siesta/lib/Siesta
In directory usw-pr-cvs1:/tmp/cvs-serv906

Modified Files:
	List.pm 
Log Message:

remove working


Index: List.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/List.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- List.pm	23 Aug 2002 07:19:53 -0000	1.14
+++ List.pm	23 Aug 2002 09:22:26 -0000	1.15
@@ -54,8 +54,10 @@
 sub add_member {
   my $self = shift;
   my ($member) = @_;
-  if (!(is_member($member))) {
-    # you can't be a member of a list twice
+
+
+  if ($self->is_member($member) == 0) {
+
   } else {
     return 0;
   }
@@ -64,8 +66,12 @@
 sub remove_member {
   my $self = shift;
   my ($member) = @_;
-  if (is_member($member)) {
-    # you have to be a member of a list to be removed
+  if ($self->is_member($member) == 1) {
+    my $address = ref($member) ? $member->id() : $member;
+    my $t_list_users = Siesta::Storage::Table::List_Users->new();
+    my @results = $t_list_users->search2(list_id => $self->{id}, user_id => $address);
+    print scalar(@results),"\n";
+    return $results[0]->delete();
   } else {
     return 0;
   }



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52