116 { |
116 { |
117 iConversationID = aEntryId; |
117 iConversationID = aEntryId; |
118 } |
118 } |
119 |
119 |
120 // ---------------------------------------------------------------------------- |
120 // ---------------------------------------------------------------------------- |
121 // Get the Conversation Entry First name from Coversation Detail class |
121 // Get the Conversation Entry Display name from Coversation Detail class |
122 // ---------------------------------------------------------------------------- |
122 // ---------------------------------------------------------------------------- |
123 HBufC* |
123 HBufC* |
124 CCsConversation::GetFirstName()const |
124 CCsConversation::GetDisplayName()const |
125 { |
125 { |
126 HBufC* fn = iContact->GetFirstName(); |
126 HBufC* fn = iContact->GetDisplayName(); |
127 if ( fn && fn->Length() > 0 ) |
127 if ( fn && fn->Length() > 0 ) |
128 return fn; |
128 return fn; |
129 |
|
130 // If last name is present don't promote phone number as first name |
|
131 HBufC* ln = iContact->GetLastName(); |
|
132 if ( ln && ln->Length() > 0 ) |
|
133 return NULL; |
|
134 |
129 |
135 RPointerArray<TDesC> pnoList; |
130 RPointerArray<TDesC> pnoList; |
136 iContact->GetPhoneNumberList(pnoList); |
131 iContact->GetPhoneNumberList(pnoList); |
137 if(pnoList.Count()) |
132 if(pnoList.Count()) |
138 { |
133 { |
139 return static_cast<HBufC*>(pnoList[0]); |
134 return static_cast<HBufC*>(pnoList[0]); |
140 } |
135 } |
141 |
136 |
142 return NULL; |
137 return NULL; |
143 } |
|
144 |
|
145 // ---------------------------------------------------------------------------- |
|
146 // Get the Conversation Entry Last name from Coversation Detail class |
|
147 // ---------------------------------------------------------------------------- |
|
148 HBufC* |
|
149 CCsConversation::GetLastName() const |
|
150 { |
|
151 return iContact->GetLastName(); |
|
152 } |
|
153 |
|
154 // ---------------------------------------------------------------------------- |
|
155 // Get the Conversation Entry Nick name from Coversation Detail class |
|
156 // ---------------------------------------------------------------------------- |
|
157 HBufC* |
|
158 CCsConversation::GetNickName() const |
|
159 { |
|
160 return iContact->GetNickName(); |
|
161 } |
138 } |
162 |
139 |
163 // ---------------------------------------------------------------------------- |
140 // ---------------------------------------------------------------------------- |
164 // CCsConversation::GetContactId |
141 // CCsConversation::GetContactId |
165 // Get the Conversation Entry Contact Id from Coversation Detail class |
142 // Get the Conversation Entry Contact Id from Coversation Detail class |
274 // this will be display name, number and contact Id |
251 // this will be display name, number and contact Id |
275 // ---------------------------------------------------------------------------- |
252 // ---------------------------------------------------------------------------- |
276 void |
253 void |
277 CCsConversation::AddContactDetailsL( |
254 CCsConversation::AddContactDetailsL( |
278 TInt32 aContactId, |
255 TInt32 aContactId, |
279 const TDesC& aFirstName, |
256 const TDesC& aDisplayName) |
280 const TDesC& aLastName, |
257 { |
281 const TDesC& aNickName) |
258 iContact->SetDisplayNameL(aDisplayName); |
282 { |
259 iContact->SetContactId (aContactId); |
283 iContact->SetFirstNameL(aFirstName); |
|
284 iContact->SetLastNameL(aLastName); |
|
285 iContact->SetContactId (aContactId); |
|
286 iContact->SetNickNameL(aNickName); |
|
287 } |
260 } |
288 |
261 |
289 // ---------------------------------------------------------------------------- |
262 // ---------------------------------------------------------------------------- |
290 // CCsConversation::AddContactDetails |
263 // CCsConversation::AddContactDetails |
291 // Add contact number for the conversation |
264 // Add contact number for the conversation |