6 |
|
|
7 |
|
#include "Atom.hpp" |
8 |
|
|
9 |
< |
Atom::Atom(const Buddy& buddy, const std::vector<AwayMessage>& messages, const Stamp& stamp) |
9 |
> |
Atom::Atom(const Buddy& buddy, const ext::String& display, const std::vector<AwayMessage>& messages, const Stamp& stamp) |
10 |
|
{ |
11 |
|
api::FileOutputStream fout(buddy.getAtom() != "-" ? buddy.getAtom() : "/dev/null"); |
12 |
|
xml::TextWriter atom(buddy.getAtom() != "-" ? fout : api::Cout.GetStream()); |
16 |
|
atom.SetAttribute("xmlns", "http://purl.org/atom/ns#"); |
17 |
|
atom.OpenElement("title"); |
18 |
|
atom.SetAttribute("mode", "escaped"); |
19 |
< |
atom.OutputText(ext::String(buddy) + "'s Away Messages"); |
19 |
> |
atom.OutputText(display + "'s Away Messages"); |
20 |
|
atom.CloseElement(); |
21 |
|
atom.OpenElement("link"); |
22 |
|
atom.SetAttribute("rel", "alternate"); |
23 |
< |
atom.SetAttribute("type", "text/html"); // XXX |
24 |
< |
atom.SetAttribute("href", "http://computers.douglasthrift.net/zoe.xml"); |
23 |
> |
atom.SetAttribute("type", "text/html"); |
24 |
> |
atom.SetAttribute("href", buddy.getLink()); |
25 |
> |
atom.CloseElement(); |
26 |
> |
atom.OpenElement("link"); |
27 |
> |
atom.SetAttribute("rel", "alternate"); |
28 |
> |
atom.SetAttribute("type", "application/rss+xml"); |
29 |
> |
atom.SetAttribute("href", buddy.getRssLink()); |
30 |
|
atom.CloseElement(); |
31 |
|
atom.OpenElement("author"); |
32 |
|
atom.OpenElement("name"); |
35 |
|
atom.CloseElement(); |
36 |
|
atom.OpenElement("tagline"); |
37 |
|
atom.SetAttribute("mode", "escaped"); |
38 |
< |
atom.OutputText(ext::String(buddy) + "'s AIM Away Messages from the past 30 days."); |
38 |
> |
atom.OutputText(display + "'s AIM Away Messages from the past 30 days."); |
39 |
|
atom.CloseElement(); |
40 |
|
atom.OpenElement("generator"); |
41 |
|
atom.SetAttribute("url", Zoe::generator(Zoe::url)); |
55 |
|
atom.CloseElement(); |
56 |
|
atom.OpenElement("link"); |
57 |
|
atom.SetAttribute("rel", "alternate"); |
58 |
< |
atom.SetAttribute("type", "text/html"); // XXX |
59 |
< |
atom.SetAttribute("href", "http://computers.douglasthrift.net/zoe.xml"); |
58 |
> |
atom.SetAttribute("type", "text/html"); |
59 |
> |
atom.SetAttribute("href", message->getLink(buddy)); |
60 |
|
atom.CloseElement(); |
61 |
|
atom.OpenElement("id"); |
62 |
< |
atom.OutputText("zoe:" + ext::String(buddy) + ":" + message->getStamp().getW3()); |
62 |
> |
atom.OutputText(message->getTag(buddy)); |
63 |
|
atom.CloseElement(); |
64 |
|
atom.OpenElement("modified"); |
65 |
|
atom.OutputText(message->getStamp().getW3()); |