2012-01-10 10:40:34 -08:00
|
|
|
/* Copyright 2011-2012 Yorba Foundation
|
2011-07-19 15:55:56 -07:00
|
|
|
*
|
|
|
|
|
* This software is licensed under the GNU Lesser General Public License
|
|
|
|
|
* (version 2.1 or later). See the COPYING file in this distribution.
|
|
|
|
|
*/
|
|
|
|
|
|
2011-10-14 18:25:51 -07:00
|
|
|
private class Geary.Imap.EmailIdentifier : Geary.EmailIdentifier {
|
2011-11-09 16:40:28 -08:00
|
|
|
public override int64 ordering { get; protected set; }
|
|
|
|
|
|
2011-07-19 15:55:56 -07:00
|
|
|
public Imap.UID uid { get; private set; }
|
|
|
|
|
|
|
|
|
|
public EmailIdentifier(Imap.UID uid) {
|
|
|
|
|
this.uid = uid;
|
2011-11-09 16:40:28 -08:00
|
|
|
ordering = uid.value;
|
2011-07-19 15:55:56 -07:00
|
|
|
}
|
|
|
|
|
|
2011-11-10 13:20:48 -08:00
|
|
|
public override uint to_hash() {
|
|
|
|
|
return Geary.Hashable.int64_hash(uid.value);
|
|
|
|
|
}
|
|
|
|
|
|
2011-07-19 15:55:56 -07:00
|
|
|
public override bool equals(Equalable o) {
|
|
|
|
|
Geary.Imap.EmailIdentifier? other = o as Geary.Imap.EmailIdentifier;
|
|
|
|
|
if (other == null)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (this == other)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return uid.value == other.uid.value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string to_string() {
|
|
|
|
|
return uid.to_string();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|