change SnowlMessage::author property to authorName in preparation for introducing an author property that references a SnowlPerson object

This commit is contained in:
Myk Melez 2009-04-16 14:27:57 -07:00
Родитель 6b03743a3e
Коммит 61dfc012b4
7 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -111,7 +111,7 @@ let SnowlMessageView = {
return this._collection.messages[aRow].source.name;
case "snowlAuthorCol":
return this._collection.messages[aRow].author;
return this._collection.messages[aRow].authorName;
case "snowlSubjectCol":
return this._collection.messages[aRow].subject ||

Просмотреть файл

@ -74,13 +74,13 @@ let content;
if (message) {
// Brief headers
document.getElementById("briefAuthor").value = message.author;
document.getElementById("briefAuthor").value = message.authorName;
document.getElementById("briefSubject").value = message.subject;
document.getElementById("briefSubject").setAttribute("href", message.link);
document.getElementById("briefTimestamp").value = SnowlDateUtils._formatDate(message.timestamp);
// Full headers
document.getElementById("author").value = message.author;
document.getElementById("author").value = message.authorName;
document.getElementById("subject").value = message.subject;
document.documentElement.setAttribute("title", message.subject);
document.getElementById("timestamp").value = SnowlDateUtils._formatDate(message.timestamp);

Просмотреть файл

@ -731,10 +731,10 @@ this._log.info("onMessageAdded: REFRESH RIVER");
bylineBox.className = "byline";
// Author and/or Source
if (message.author)
if (message.authorName)
bylineBox.appendChild(this._document.createTextNode(message.author));
if (message.source) {
if (message.author)
if (message.authorName)
bylineBox.appendChild(this._document.createTextNode(" - "));
bylineBox.appendChild(this._document.createTextNode(message.source.name));
}

Просмотреть файл

@ -311,11 +311,11 @@ let SnowlMessageView = {
messageBox.appendChild(centerColumn);
// Author or Source
if (message.author || message.source) {
if (message.authorName || message.source) {
let desc = this._document.createElementNS(XUL_NS, "description");
desc.className = "author";
desc.setAttribute("crop", "end");
desc.setAttribute("value", message.author || message.source.name);
desc.setAttribute("value", message.authorName || message.source.name);
centerColumn.appendChild(desc);
}

Просмотреть файл

@ -264,7 +264,7 @@ this._log.info("got " + groups.length + " groups");
id: statement.row.messageID,
sourceID: statement.row.sourceID,
subject: statement.row.subject,
author: statement.row.author,
authorName: statement.row.authorName,
authorID: statement.row.authorID,
link: statement.row.link,
timestamp: SnowlDateUtils.julianToJSDate(statement.row.timestamp),
@ -306,7 +306,7 @@ this._log.info("got " + groups.length + " groups");
"messages.timestamp",
"messages.read",
"messages.received",
"authors.name AS author",
"authors.name AS authorName",
"authors.iconURL AS authorIcon",
"parts.id AS partID",
"parts.content",

Просмотреть файл

@ -66,7 +66,7 @@ SnowlMessage.get = function(id) {
let message;
let statement = SnowlDatastore.createStatement(
"SELECT sourceID, subject, authors.name AS author, link, timestamp, read, " +
"SELECT sourceID, subject, authors.name AS authorName, link, timestamp, read, " +
" authors.iconURL AS authorIcon, received, authorID " +
"FROM messages LEFT JOIN people AS authors ON messages.authorID = authors.id " +
"WHERE messages.id = :id"
@ -79,7 +79,7 @@ SnowlMessage.get = function(id) {
id: id,
sourceID: statement.row.sourceID,
subject: statement.row.subject,
author: statement.row.author,
authorName: statement.row.authorName,
authorID: statement.row.authorID,
link: statement.row.link,
timestamp: SnowlDateUtils.julianToJSDate(statement.row.timestamp),

Просмотреть файл

@ -45,7 +45,7 @@ function finish_test() {
do_check_eq(message.id.constructor.name, "Number");
do_check_eq(message.sourceID, account.id);
do_check_eq(message.subject, "Atom-Powered Robots Run Amok");
do_check_eq(message.author, "John Doe");
do_check_eq(message.authorName, "John Doe");
// TODO: do_check_eq(message.authorID, authorID);
do_check_eq(message.link, "http://example.org/2003/12/13/atom03");
do_check_eq(message.timestamp.getTime(), 1071340202000);