- Timestamp:
- 2009-01-07T01:35:44Z (16 years ago)
- Branches:
- master
- Children:
- ff436ba
- Parents:
- 2709f4c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skype.c
r2709f4c r607f5e3 790 790 } 791 791 792 static void skype_parse_profile(struct im_connection *ic, char *line) 793 { 794 imcb_log(ic, "SkypeOut balance value is '%s'.", line+21); 795 } 796 797 static void skype_parse_ping(struct im_connection *ic, char *line) 798 { 799 skype_write(ic, "PONG\n"); 800 } 801 802 static void skype_parse_chats(struct im_connection *ic, char *line) 803 { 804 char buf[1024]; 805 char **i; 806 char **chats = g_strsplit(line + 6, ", ", 0); 807 808 i = chats; 809 while (*i) { 810 g_snprintf(buf, 1024, "GET CHAT %s STATUS\n", *i); 811 skype_write(ic, buf); 812 g_snprintf(buf, 1024, "GET CHAT %s ACTIVEMEMBERS\n", *i); 813 skype_write(ic, buf); 814 i++; 815 } 816 g_strfreev(chats); 817 } 818 792 819 static gboolean skype_read_callback(gpointer data, gint fd, 793 820 b_input_condition cond) … … 825 852 else if (!strncmp(line, "CHAT ", 5)) 826 853 skype_parse_chat(ic, line); 827 else if (!strncmp(line, "PASSWORD ", 9)) {854 else if (!strncmp(line, "PASSWORD ", 9)) 828 855 skype_parse_password(ic, line); 829 } else if (!strncmp(line, "PROFILE PSTN_BALANCE ", 21)) 830 imcb_log(ic, "SkypeOut balance value is '%s'.", line+21); 831 else if (!strncmp(line, "PING", 4)) { 832 g_snprintf(buf, 1024, "PONG\n"); 833 skype_write(ic, buf); 834 } else if (!strncmp(line, "CHATS ", 6)) { 835 char **i; 836 char **chats = g_strsplit(line + 6, ", ", 0); 837 838 i = chats; 839 while (*i) { 840 g_snprintf(buf, 1024, "GET CHAT %s STATUS\n", *i); 841 skype_write(ic, buf); 842 g_snprintf(buf, 1024, "GET CHAT %s ACTIVEMEMBERS\n", *i); 843 skype_write(ic, buf); 844 i++; 845 } 846 g_strfreev(chats); 847 } 856 else if (!strncmp(line, "PROFILE PSTN_BALANCE ", 21)) 857 skype_parse_profile(ic, line); 858 else if (!strncmp(line, "PING", 4)) 859 skype_parse_ping(ic, line); 860 else if (!strncmp(line, "CHATS ", 6)) 861 skype_parse_chats(ic, line); 848 862 lineptr++; 849 863 }
Note: See TracChangeset
for help on using the changeset viewer.