Changeset 8c3637b for protocols/rpc/rpc.c
- Timestamp:
- 2015-05-24T19:43:09Z (9 years ago)
- Children:
- a852b2b
- Parents:
- 93e0901
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/rpc/rpc.c
r93e0901 r8c3637b 605 605 } 606 606 607 static JSON_Value *rpc_imcb_get_local_contacts(struct im_connection *ic, void *func_, JSON_Array *params) { 608 JSON_Value *resp = json_value_init_object(); 609 JSON_Value *arr = json_value_init_array(); 610 GSList *contacts = imcb_get_local_contacts(ic); 611 GSList *c; 612 for (c = contacts; c; c = c->next) { 613 json_array_append_string(json_array(arr), (const char*) c->data); 614 } 615 g_slist_free(contacts); 616 json_object_set_value(json_object(resp), "result", arr); 617 return resp; 618 } 619 607 620 static JSON_Value *rpc_imcb_chat_new(struct im_connection *ic, void *func_, JSON_Array *params) { 608 621 struct rpc_groupchat *rc = rpc_groupchat_new(ic, json_array_get_string(params, 0)); … … 719 732 { "imcb_buddy_msg", imcb_buddy_msg, rpc_imcb_buddy_msg, "ssii" }, 720 733 { "imcb_buddy_typing", imcb_buddy_typing, rpc_imcb_buddy_typing, "si" }, 734 { "imcb_get_local_contacts", NULL, rpc_imcb_get_local_contacts, "" }, 721 735 { "imcb_chat_new", NULL, rpc_imcb_chat_new, "s" }, 722 736
Note: See TracChangeset
for help on using the changeset viewer.