| 628 return PURPLE_DISCO_SERVICE_TYPE_CHAT; |
628 return PURPLE_DISCO_SERVICE_TYPE_CHAT; |
| 629 |
629 |
| 630 return PURPLE_DISCO_SERVICE_TYPE_OTHER; |
630 return PURPLE_DISCO_SERVICE_TYPE_OTHER; |
| 631 } |
631 } |
| 632 |
632 |
| |
633 static struct { |
| |
634 const char *from; |
| |
635 const char *to; |
| |
636 } disco_type_mappings[] = { |
| |
637 { "gadu-gadu", "gg" }, |
| |
638 { "sametime", "meanwhile" }, |
| |
639 { "myspaceim", "myspace" }, |
| |
640 { "xmpp", "jabber" }, |
| |
641 { NULL, NULL } |
| |
642 }; |
| |
643 |
| 633 static const gchar * |
644 static const gchar * |
| 634 jabber_disco_type_from_string(const gchar *str) |
645 jabber_disco_type_from_string(const gchar *str) |
| 635 { |
646 { |
| 636 if (!strcasecmp(str, "aim")) |
647 int i = 0; |
| 637 return "aim"; |
648 |
| 638 else if (!strcasecmp(str, "gadu-gadu")) |
649 g_return_val_if_fail(str != NULL, ""); |
| 639 return "gg"; |
650 |
| 640 else if (!strcasecmp(str, "icq")) |
651 for ( ; disco_type_mappings[i].from; ++i) { |
| 641 return "icq"; |
652 if (!strcasecmp(str, disco_type_mappings[i].from)) |
| 642 else if (!strcasecmp(str, "irc")) |
653 return disco_type_mappings[i].to; |
| 643 return "irc"; |
654 } |
| 644 else if (!strcasecmp(str, "msn")) |
|
| 645 return "msn"; |
|
| 646 else if (!strcasecmp(str, "qq")) |
|
| 647 return "qq"; |
|
| 648 else if (!strcasecmp(str, "smtp")) |
|
| 649 return "smtp"; |
|
| 650 else if (!strcasecmp(str, "xmpp")) |
|
| 651 return "jabber"; |
|
| 652 else if (!strcasecmp(str, "yahoo")) |
|
| 653 return "yahoo"; |
|
| 654 |
655 |
| 655 /* fallback to the string itself */ |
656 /* fallback to the string itself */ |
| 656 return str; |
657 return str; |
| 657 } |
658 } |
| 658 |
659 |