]> git.0d.be Git - empathy.git/blob - python/pyempathy/pyempathy.override
Python binding for empathy_dispatcher_chat_with_contact_id: Take the
[empathy.git] / python / pyempathy / pyempathy.override
1 %%
2 headers
3 #include <Python.h>
4 #include <pygobject.h>
5 #include "empathy-chatroom.h"
6 #include "empathy-chatroom-manager.h"
7 #include "empathy-contact.h"
8 #include "empathy-contact-factory.h"
9 #include "empathy-contact-groups.h"
10 #include "empathy-contact-list.h"
11 #include "empathy-contact-manager.h"
12 #include "empathy-debug.h"
13 #include "empathy-dispatcher.h"
14 #include "empathy-enum-types.h"
15 #include "empathy-idle.h"
16 #include "empathy-irc-network.h"
17 #include "empathy-irc-network-manager.h"
18 #include "empathy-irc-server.h"
19 #include "empathy-log-manager.h"
20 #include "empathy-message.h"
21 #include "empathy-status-presets.h"
22 #include "empathy-time.h"
23 #include "empathy-tp-call.h"
24 #include "empathy-tp-chat.h"
25 #include "empathy-tp-contact-factory.h"
26 #include "empathy-tp-contact-list.h"
27 #include "empathy-tp-group.h"
28 #include "empathy-tp-roomlist.h"
29 #include "empathy-tp-tube.h"
30 #include "empathy-tube-handler.h"
31 #include "empathy-utils.h"
32
33 void empathy_add_constants(PyObject *module, const gchar *strip_prefix);
34 void empathy_register_classes(PyObject *d);
35
36 %%
37 modulename empathy
38 %%
39 ignore-glob
40         *_get_type
41 %%
42 import gobject.GObject as PyGObject_Type
43 %%
44 override empathy_contact_list_get_members kwargs
45 static PyObject *
46 _wrap_empathy_contact_list_get_members(PyGObject *self, PyObject *args, PyObject *kwargs)
47 {
48
49         PyObject *py_contacts = PyList_New(0);
50         GList *l, *contacts;
51
52         contacts = empathy_contact_list_get_members(EMPATHY_CONTACT_LIST(self->obj));
53
54         for (l = contacts; l; l = l->next) {
55                 EmpathyContact *contact;
56                 contact = l->data;
57                 PyList_Append(py_contacts, pygobject_new((GObject *) contact));
58         }
59
60         return py_contacts;
61
62 }
63 %%
64 override empathy_dispatcher_chat_with_contact_id kwargs
65 static PyObject *
66 _wrap_empathy_dispatcher_chat_with_contact_id(PyObject *self, PyObject *args, PyObject *kwargs)
67 {
68     static char *kwlist[] = { "account_id", "contact_id", NULL };
69     char *account_id, *contact_id;
70     McAccount *account;
71
72     if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ss:dispatcher_chat_with_contact_id", kwlist, &account_id, &contact_id))
73         return NULL;
74
75     account = mc_account_lookup (account_id);
76     if (account) {
77         empathy_dispatcher_chat_with_contact_id(account, contact_id);
78         g_object_unref (account);
79     }
80     
81     Py_INCREF(Py_None);
82     return Py_None;
83 }
84 %%