~ubuntu-branches/ubuntu/precise/folks/precise

« back to all changes in this revision

Viewing changes to tools/import-pidgin.vala

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2011-06-10 11:28:11 UTC
  • mfrom: (1.2.11 upstream) (4.2.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110610112811-whyeodbo9mjezxfp
Tags: 0.5.2-1ubuntu1
* Merge with Debian experimental, remaining Ubuntu changes:
  - debian/control:
    + Add Vcs-Bzr link

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
  private async Persona? parse_contact (Xml.Node *contact_node)
168
168
    {
169
169
      string alias = null;
170
 
      HashTable<string, LinkedHashSet<string>> im_addresses =
171
 
          new HashTable<string, LinkedHashSet<string>> (str_hash, str_equal);
 
170
      var im_addresses = new HashMultiMap<string, string> ();
172
171
      string im_address_string = "";
173
172
 
174
173
      /* Parse the <buddy> elements beneath <contact> */
202
201
                   * we need to insert into the Persona's im-addresses property
203
202
                   * for the linking to work. */
204
203
                  string im_address = subiter->get_content ();
205
 
 
206
 
                  LinkedHashSet<string> im_address_set =
207
 
                      im_addresses.lookup (tp_protocol);
208
 
                  if (im_address_set == null)
209
 
                    {
210
 
                      im_address_set = new LinkedHashSet<string> ();
211
 
                      im_addresses.insert (tp_protocol, im_address_set);
212
 
                    }
213
 
 
214
 
                  im_address_set.add (im_address);
 
204
                  im_addresses.set (tp_protocol, im_address);
215
205
                  im_address_string += "    %s\n".printf (im_address);
216
206
                }
217
207
            }
218
208
        }
219
209
 
220
210
      /* Don't bother if there's no alias and only one IM address */
221
 
      if (im_addresses.size () < 2 &&
 
211
      if (im_addresses.size < 2 &&
222
212
          (alias == null || alias.strip () == "" ||
223
213
           alias.strip () == im_address_string.strip ()))
224
214
        {
232
222
      /* Create or update the relevant Persona */
233
223
      HashTable<string, Value?> details =
234
224
          new HashTable<string, Value?> (str_hash, str_equal);
235
 
      Value im_addresses_value = Value (typeof (HashTable));
236
 
      im_addresses_value.set_boxed (im_addresses);
 
225
      Value im_addresses_value = Value (typeof (MultiMap));
 
226
      im_addresses_value.set_object (im_addresses);
237
227
      details.insert ("im-addresses", im_addresses_value);
238
228
 
239
229
      Persona persona;