--- trunk/Nos.pm 2005/06/21 21:24:10 60 +++ trunk/Nos.pm 2005/06/22 12:31:45 62 @@ -343,7 +343,7 @@ my $this_user = $user->search( email => $args->{'email'} )->first || croak "can't find user: ".$args->{'email'}; my $this_list = $list->search( name => $args->{'list'} )->first || croak "can't find list: ".$args->{'list'}; - my $this_user_list = $user_list->search_where( list_id => $this_list->id, user_id => $this_list->id )->first || return; + my $this_user_list = $user_list->search_where( list_id => $this_list->id, user_id => $this_user->id )->first || return; $this_user_list->delete || croak "can't delete user from list\n"; @@ -801,6 +801,10 @@ Returns array of hashes with user informations, see C. +Returning arrays from SOAP calls is somewhat fuzzy (at least to me). It +seems that SOAP::Lite client thinks that it has array with one element which +is array of hashes with data. + =cut sub ListMembers { @@ -814,9 +818,32 @@ $list_name = $_[0]->{'list'}; } - return $nos->list_members( list => $list_name ); + return [ $nos->list_members( list => $list_name ) ]; +} + + +=head2 DeleteMemberFromList + + $member_id = DeleteMemberFromList( + list => 'My list', + email => 'e-mail@example.com', + ); + +=cut + +sub DeleteMemberFromList { + my $self = shift; + + if ($_[0] !~ m/^HASH/) { + return $nos->delete_member_from_list( + list => $_[0], email => $_[1], + ); + } else { + return $nos->delete_member_from_list( %{ shift @_ } ); + } } + =head2 AddMessageToList $message_id = AddMessageToList(