schedulator: added a "result" plugin that records the finished schedule in a database...
[wvapps.git] / evolution / listusers.cc
blob29f7699ea38a2f5aa64a709e6904f710b09798f4
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: s; c-basic-offset: 4 -*- */
2 /*
3 * Authors : Patrick Patterson <ppatters@nit.ca>
4 * Peter Colijn <pcolijn@nit.ca>
5 * Scott MacLean <scott@nit.ca>
6 * William Lachance <wlach@nit.ca>
8 * Copyright 2003-2004, Net Integration Technologies, Inc.
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
25 #include "listusers.h"
27 bool ListUsers::apply_response(WvStringList &parts,
28 WvStream &stream,
29 ExchangeItStorage *storage)
31 if (parts.count() < 1)
33 log("Malformed response: no response!!\n");
34 return false;
37 WvString line;
38 WvString response = parts.popstr();
40 if (response == "USERS")
42 user_store.remove();
43 while (!!(line = stream.blocking_getline(TIMEOUT)))
45 log("<< (%s)\n", line);
46 user_store[line].setmeint(1);
49 else
51 log("Unknown response to LISTUSERS: %s\n", response);
52 return false;
55 return true;
58 void ListUsers::get_command(WvString &command,
59 WvStringList &params,
60 WvStringList &lines)
62 // When they're not used, it's still important to zap() these!
63 params.zap();
64 lines.zap();
66 command = "LISTUSERS";