blob: 2926b4331e78c5b13ac18732f0fd68ce0b1b0dc1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Protocol buffer definitions for the user's contacts.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package contacts;
// A contact, roughly based on the GData Contact kind:
// https://developers.google.com/gdata/docs/2.0/elements#gdContactKind
// All strings are UTF-8 with Unicode byte order marks stripped out.
message Contact {
// Next ID to use: 16
// Provider-assigned unique identifier.
optional string contact_id = 1;
// Last time at which this contact was updated within the upstream provider,
// as given by base::Time::ToInternalValue().
optional int64 update_time = 2;
// Has the contact been deleted recently within the upstream provider?
optional bool deleted = 3 [default = false];
// Affinity between the user and this contact, in the range [0.0, 1.0].
// Unset if the affinity is unknown.
optional float affinity = 15;
// Taken from https://developers.google.com/gdata/docs/2.0/elements#gdName.
optional string full_name = 4;
optional string given_name = 5;
optional string additional_name = 6;
optional string family_name = 7;
optional string name_prefix = 8;
optional string name_suffix = 9;
// Raw photo data as supplied by the provider. This data is untrusted and
// must be decoded within a sandbox by e.g. ImageDecoder before being used.
// Unset if no photo is available.
optional bytes raw_untrusted_photo = 10;
// Describes an address-like message's type.
message AddressType {
// Next ID to use: 3
enum Relation {
HOME = 0;
WORK = 1;
MOBILE = 2;
OTHER = 3;
}
optional Relation relation = 1 [default = OTHER];
optional string label = 2;
}
message EmailAddress {
// Next ID to use: 4
optional string address = 1;
optional AddressType type = 2;
optional bool primary = 3 [default = false];
}
repeated EmailAddress email_addresses = 11;
message PhoneNumber {
// Next ID to use: 4
optional string number = 1;
optional AddressType type = 2;
optional bool primary = 3 [default = false];
}
repeated PhoneNumber phone_numbers = 12;
message PostalAddress {
// Next ID to use: 4
optional string address = 1;
optional AddressType type = 2;
optional bool primary = 3 [default = false];
}
repeated PostalAddress postal_addresses = 13;
message InstantMessagingAddress {
// Next ID to use: 5
optional string address = 1;
// Taken from https://developers.google.com/gdata/docs/2.0/elements#gdIm.
enum Protocol {
AIM = 0;
MSN = 1;
YAHOO = 2;
SKYPE = 3;
QQ = 4;
GOOGLE_TALK = 5;
ICQ = 6;
JABBER = 7;
OTHER = 8;
}
optional Protocol protocol = 2 [default = OTHER];
optional AddressType type = 3;
optional bool primary = 4 [default = false];
}
repeated InstantMessagingAddress instant_messaging_addresses = 14;
}
// Singleton message used by ContactDatabase to store update-related metadata.
message UpdateMetadata {
// Next ID to use: 3
// Time at which the last successful update was started, as given by
// base::Time::ToInternalValue().
optional int64 last_update_start_time = 1;
// Latest time that we've seen in a contact's |update_time| field. Note that
// the time may have come from a deleted contact that has been discarded.
optional int64 last_contact_update_time = 2;
}
|