Mercurial > pidgin.yaz
comparison libpurple/protocols/silc/silc.c @ 32790:3e7a7e14af62
Our API really shouldn't have a 'gc' in it anymore.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Mon, 24 Oct 2011 05:37:19 +0000 |
parents | 6135b24cdc8a |
children |
comparison
equal
deleted
inserted
replaced
32789:fb2458f2326b | 32790:3e7a7e14af62 |
---|---|
1546 { | 1546 { |
1547 PurpleConnection *gc; | 1547 PurpleConnection *gc; |
1548 PurpleConversation *convo = conv; | 1548 PurpleConversation *convo = conv; |
1549 int id = 0; | 1549 int id = 0; |
1550 | 1550 |
1551 gc = purple_conversation_get_gc(conv); | 1551 gc = purple_conversation_get_connection(conv); |
1552 | 1552 |
1553 if (gc == NULL) | 1553 if (gc == NULL) |
1554 return PURPLE_CMD_RET_FAILED; | 1554 return PURPLE_CMD_RET_FAILED; |
1555 | 1555 |
1556 if(args && args[0]) | 1556 if(args && args[0]) |
1575 PurpleConnection *gc; | 1575 PurpleConnection *gc; |
1576 int id = 0; | 1576 int id = 0; |
1577 char *buf, *tmp, *tmp2; | 1577 char *buf, *tmp, *tmp2; |
1578 const char *topic; | 1578 const char *topic; |
1579 | 1579 |
1580 gc = purple_conversation_get_gc(conv); | 1580 gc = purple_conversation_get_connection(conv); |
1581 id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)); | 1581 id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)); |
1582 | 1582 |
1583 if (gc == NULL || id == 0) | 1583 if (gc == NULL || id == 0) |
1584 return PURPLE_CMD_RET_FAILED; | 1584 return PURPLE_CMD_RET_FAILED; |
1585 | 1585 |
1621 | 1621 |
1622 g_hash_table_replace(comp, "channel", args[0]); | 1622 g_hash_table_replace(comp, "channel", args[0]); |
1623 if(args[1]) | 1623 if(args[1]) |
1624 g_hash_table_replace(comp, "passphrase", args[1]); | 1624 g_hash_table_replace(comp, "passphrase", args[1]); |
1625 | 1625 |
1626 silcpurple_chat_join(purple_conversation_get_gc(conv), comp); | 1626 silcpurple_chat_join(purple_conversation_get_connection(conv), comp); |
1627 | 1627 |
1628 g_hash_table_destroy(comp); | 1628 g_hash_table_destroy(comp); |
1629 return PURPLE_CMD_RET_OK; | 1629 return PURPLE_CMD_RET_OK; |
1630 } | 1630 } |
1631 | 1631 |
1632 static PurpleCmdRet silcpurple_cmd_chat_list(PurpleConversation *conv, | 1632 static PurpleCmdRet silcpurple_cmd_chat_list(PurpleConversation *conv, |
1633 const char *cmd, char **args, char **error, void *data) | 1633 const char *cmd, char **args, char **error, void *data) |
1634 { | 1634 { |
1635 PurpleConnection *gc; | 1635 PurpleConnection *gc; |
1636 gc = purple_conversation_get_gc(conv); | 1636 gc = purple_conversation_get_connection(conv); |
1637 purple_roomlist_show_with_account(purple_connection_get_account(gc)); | 1637 purple_roomlist_show_with_account(purple_connection_get_account(gc)); |
1638 return PURPLE_CMD_RET_OK; | 1638 return PURPLE_CMD_RET_OK; |
1639 } | 1639 } |
1640 | 1640 |
1641 static PurpleCmdRet silcpurple_cmd_whois(PurpleConversation *conv, | 1641 static PurpleCmdRet silcpurple_cmd_whois(PurpleConversation *conv, |
1642 const char *cmd, char **args, char **error, void *data) | 1642 const char *cmd, char **args, char **error, void *data) |
1643 { | 1643 { |
1644 PurpleConnection *gc; | 1644 PurpleConnection *gc; |
1645 | 1645 |
1646 gc = purple_conversation_get_gc(conv); | 1646 gc = purple_conversation_get_connection(conv); |
1647 | 1647 |
1648 if (gc == NULL) | 1648 if (gc == NULL) |
1649 return PURPLE_CMD_RET_FAILED; | 1649 return PURPLE_CMD_RET_FAILED; |
1650 | 1650 |
1651 silcpurple_get_info(gc, args[0]); | 1651 silcpurple_get_info(gc, args[0]); |
1657 const char *cmd, char **args, char **error, void *data) | 1657 const char *cmd, char **args, char **error, void *data) |
1658 { | 1658 { |
1659 int ret; | 1659 int ret; |
1660 PurpleConnection *gc; | 1660 PurpleConnection *gc; |
1661 | 1661 |
1662 gc = purple_conversation_get_gc(conv); | 1662 gc = purple_conversation_get_connection(conv); |
1663 | 1663 |
1664 if (gc == NULL) | 1664 if (gc == NULL) |
1665 return PURPLE_CMD_RET_FAILED; | 1665 return PURPLE_CMD_RET_FAILED; |
1666 | 1666 |
1667 ret = silcpurple_send_im(gc, args[0], args[1], PURPLE_MESSAGE_SEND); | 1667 ret = silcpurple_send_im(gc, args[0], args[1], PURPLE_MESSAGE_SEND); |
1683 if (!args || !args[0]) { | 1683 if (!args || !args[0]) { |
1684 *error = g_strdup(_("You must specify a nick")); | 1684 *error = g_strdup(_("You must specify a nick")); |
1685 return PURPLE_CMD_RET_FAILED; | 1685 return PURPLE_CMD_RET_FAILED; |
1686 } | 1686 } |
1687 | 1687 |
1688 gc = purple_conversation_get_gc(conv); | 1688 gc = purple_conversation_get_connection(conv); |
1689 | 1689 |
1690 if (gc == NULL) | 1690 if (gc == NULL) |
1691 return PURPLE_CMD_RET_FAILED; | 1691 return PURPLE_CMD_RET_FAILED; |
1692 | 1692 |
1693 account = purple_connection_get_account(gc); | 1693 account = purple_connection_get_account(gc); |
1711 { | 1711 { |
1712 PurpleConnection *gc; | 1712 PurpleConnection *gc; |
1713 SilcPurple sg; | 1713 SilcPurple sg; |
1714 char *tmp; | 1714 char *tmp; |
1715 | 1715 |
1716 gc = purple_conversation_get_gc(conv); | 1716 gc = purple_conversation_get_connection(conv); |
1717 | 1717 |
1718 if (gc == NULL) | 1718 if (gc == NULL) |
1719 return PURPLE_CMD_RET_FAILED; | 1719 return PURPLE_CMD_RET_FAILED; |
1720 | 1720 |
1721 sg = purple_connection_get_protocol_data(gc); | 1721 sg = purple_connection_get_protocol_data(gc); |
1740 const char *cmd, char **args, char **error, void *data) | 1740 const char *cmd, char **args, char **error, void *data) |
1741 { | 1741 { |
1742 PurpleConnection *gc; | 1742 PurpleConnection *gc; |
1743 SilcPurple sg; | 1743 SilcPurple sg; |
1744 | 1744 |
1745 gc = purple_conversation_get_gc(conv); | 1745 gc = purple_conversation_get_connection(conv); |
1746 | 1746 |
1747 if (gc == NULL) | 1747 if (gc == NULL) |
1748 return PURPLE_CMD_RET_FAILED; | 1748 return PURPLE_CMD_RET_FAILED; |
1749 | 1749 |
1750 sg = purple_connection_get_protocol_data(gc); | 1750 sg = purple_connection_get_protocol_data(gc); |
1765 SilcPurple sg; | 1765 SilcPurple sg; |
1766 SilcChannelEntry channel; | 1766 SilcChannelEntry channel; |
1767 char *silccmd, *silcargs, *msg, tmp[256]; | 1767 char *silccmd, *silcargs, *msg, tmp[256]; |
1768 const char *chname; | 1768 const char *chname; |
1769 | 1769 |
1770 gc = purple_conversation_get_gc(conv); | 1770 gc = purple_conversation_get_connection(conv); |
1771 | 1771 |
1772 if (gc == NULL || !args || purple_connection_get_protocol_data(gc) == NULL) | 1772 if (gc == NULL || !args || purple_connection_get_protocol_data(gc) == NULL) |
1773 return PURPLE_CMD_RET_FAILED; | 1773 return PURPLE_CMD_RET_FAILED; |
1774 | 1774 |
1775 sg = purple_connection_get_protocol_data(gc); | 1775 sg = purple_connection_get_protocol_data(gc); |
1816 { | 1816 { |
1817 PurpleConnection *gc; | 1817 PurpleConnection *gc; |
1818 SilcPurple sg; | 1818 SilcPurple sg; |
1819 char *silccmd, *silcargs; | 1819 char *silccmd, *silcargs; |
1820 | 1820 |
1821 gc = purple_conversation_get_gc(conv); | 1821 gc = purple_conversation_get_connection(conv); |
1822 | 1822 |
1823 if (gc == NULL) | 1823 if (gc == NULL) |
1824 return PURPLE_CMD_RET_FAILED; | 1824 return PURPLE_CMD_RET_FAILED; |
1825 | 1825 |
1826 sg = purple_connection_get_protocol_data(gc); | 1826 sg = purple_connection_get_protocol_data(gc); |
1848 SilcPurple sg; | 1848 SilcPurple sg; |
1849 GHashTable *ui_info; | 1849 GHashTable *ui_info; |
1850 const char *ui_name = NULL, *ui_website = NULL; | 1850 const char *ui_name = NULL, *ui_website = NULL; |
1851 char *quit_msg; | 1851 char *quit_msg; |
1852 | 1852 |
1853 gc = purple_conversation_get_gc(conv); | 1853 gc = purple_conversation_get_connection(conv); |
1854 | 1854 |
1855 if (gc == NULL) | 1855 if (gc == NULL) |
1856 return PURPLE_CMD_RET_FAILED; | 1856 return PURPLE_CMD_RET_FAILED; |
1857 | 1857 |
1858 sg = purple_connection_get_protocol_data(gc); | 1858 sg = purple_connection_get_protocol_data(gc); |
1885 const char *cmd, char **args, char **error, void *data) | 1885 const char *cmd, char **args, char **error, void *data) |
1886 { | 1886 { |
1887 PurpleConnection *gc; | 1887 PurpleConnection *gc; |
1888 SilcPurple sg; | 1888 SilcPurple sg; |
1889 | 1889 |
1890 gc = purple_conversation_get_gc(conv); | 1890 gc = purple_conversation_get_connection(conv); |
1891 | 1891 |
1892 if (gc == NULL) | 1892 if (gc == NULL) |
1893 return PURPLE_CMD_RET_FAILED; | 1893 return PURPLE_CMD_RET_FAILED; |
1894 | 1894 |
1895 sg = purple_connection_get_protocol_data(gc); | 1895 sg = purple_connection_get_protocol_data(gc); |