ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/WinXPFAQPoll/Poller.cpp
(Generate patch)

Comparing trunk/WinXPFAQPoll/Poller.cpp (file contents):
Revision 230 by douglas, 2003-08-05T19:01:05-07:00 vs.
Revision 231 by douglas, 2003-08-05T20:36:00-07:00

# Line 258 | Line 258 | void Poller::save()
258  
259   void Poller::ballots()
260   {
261 <        stringstream search;
262 <        search << session->search(string("ALL HEADER X-Mailer \"WinXPFAQPoll 1.0 ")
263 <                + "(Perl)\" SUBJECT \"Windows XP FAQ | Poll Ballot\" FROM \"Windows XP"
264 <                + " FAQ | Poll\"");
261 >        istringstream search(session->search(string("ALL HEADER X-Mailer \"WinXPFA")
262 >                + "QPoll 1.0 (Perl)\" SUBJECT \"Windows XP FAQ | Poll Ballot\" FROM \"W"
263 >                + "indows XP FAQ | Poll\""));
264  
265 <        search.ignore(9);
267 <
268 <        while (!isdigit(search.peek()) && search.good())
265 >        while (search.good())
266          {
267 +                char next = search.peek();
268 +
269 +                if (isdigit(next)) break;
270 +                
271                  search.get();
272          }
273  
# Line 316 | Line 317 | void Poller::ballot(unsigned message)
317          ostringstream number;
318          number << message;
319  
319        stringstream buffer;
320          string junk;
321 <
322 <        buffer << session->fetch(number.str() + " BODY.PEEK[2]");
321 >        istringstream buffer(session->fetch(number.str() + " BODY.PEEK[2]"));
322  
323          if (session->successful() && buffer.str() == "* " + number.str() + " FETCH"
324                  + " (BODY[2] \"\")\n")
325          {
326 <                do
328 <                {
329 <                        getline(buffer, junk);
330 <                }
331 <                while (buffer.good());
332 <
333 <                buffer.clear();
334 <
335 <                buffer << session->fetch(number.str() + " BODY.PEEK[TEXT]");
326 >                buffer.str(session->fetch(number.str() + " BODY.PEEK[TEXT]"));
327  
328                  for (unsigned index = 0; index < 25; index++)
329                  {
# Line 655 | Line 646 | short Poller::approval(const string& typ
646   {
647          short answer = -1;
648  
649 <        stringstream search;
650 <        search << session->search(string("ALL HEADER X-Mailer \"WinXPFAQPoll 1.0")
651 <                + "\" SUBJECT \"Windows XP FAQ | Poll Submit\" FROM \"Windows XP FAQ |"
652 <                + " Poll\" HEADER X-WinXPFAQPoll-Submit-Type \"" + type + "\" HEADER X"
653 <                + "-WinXPFAQPoll-Submit-Text \"" + text + '\"');
649 >        istringstream search(session->search(string("ALL HEADER X-Mailer \"WinXPF")
650 >                + "AQPoll 1.0\" SUBJECT \"Windows XP FAQ | Poll Submit\" FROM \"Window"
651 >                + "s XP FAQ | Poll\" HEADER X-WinXPFAQPoll-Submit-Type \"" + type
652 >                + "\" HEADER X-WinXPFAQPoll-Submit-Text \"" + text + '\"'));
653 >
654 >        while (search.good())
655 >        {
656 >                char next = search.peek();
657  
658 <        search.ignore(9);
659 <        search.peek();
658 >                if (isdigit(next)) break;
659 >                
660 >                search.get();
661 >        }
662  
663          if (search.good())
664          {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines