- Timestamp:
- 2010-12-13T02:22:20Z (14 years ago)
- Branches:
- master
- Children:
- 451f121
- Parents:
- 77aa416
- Location:
- skype
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/README
r77aa416 r71c4bb6 307 307 communication is encrypted. 308 308 309 - Managing outgoing calls (with call duration at the end, including 310 SkypeOut calls if you use a phone number instead of a nick): 311 312 * `account skype set call nick` 313 * `account skype set -del skype/call` 309 - Managing outgoing calls (with call duration at the end): 310 311 * `/ctcp nick call` 312 * `/ctcp nick hangup` 313 314 - Managing outgoing SkypeOut or conference calls: 315 316 * `account skype set call +18005551234` 317 * `account skype set call nick1 nick2` 318 * `account skype set -del call` 314 319 315 320 - Managing incoming calls via questions, just like when you add / remove -
skype/skype.c
r77aa416 r71c4bb6 1118 1118 } 1119 1119 1120 static void skype_call(struct im_connection *ic, char *value) { 1121 char *nick = g_strdup(value); 1122 char *ptr = strchr(nick, '@'); 1123 1124 if (ptr) 1125 *ptr = '\0'; 1126 skype_printf(ic, "CALL %s", nick); 1127 g_free(nick); 1128 } 1129 1130 static void skype_hangup(struct im_connection *ic) 1131 { 1132 struct skype_data *sd = ic->proto_data; 1133 1134 if (sd->call_id) { 1135 skype_printf(ic, "SET CALL %s STATUS FINISHED", 1136 sd->call_id); 1137 g_free(sd->call_id); 1138 sd->call_id = 0; 1139 } else 1140 imcb_error(ic, "There are no active calls currently."); 1141 } 1142 1120 1143 static char *skype_set_call(set_t *set, char *value) 1121 1144 { 1122 1145 account_t *acc = set->data; 1123 1146 struct im_connection *ic = acc->ic; 1124 struct skype_data *sd = ic->proto_data; 1125 char *nick, *ptr; 1147 char *nick; 1126 1148 1127 1149 if (value) { … … 1131 1153 /* We are starting a call */ 1132 1154 if (u) 1133 nick = g_strdup(u->handle);1155 nick = u->handle; 1134 1156 else 1135 1157 #endif 1136 nick = g_strdup(value); 1137 ptr = strchr(nick, '@'); 1138 if (ptr) 1139 *ptr = '\0'; 1140 1141 skype_printf(ic, "CALL %s", nick); 1142 g_free(nick); 1143 } else { 1144 /* We are ending a call */ 1145 if (sd->call_id) { 1146 skype_printf(ic, "SET CALL %s STATUS FINISHED", 1147 sd->call_id); 1148 g_free(sd->call_id); 1149 sd->call_id = NULL; 1150 } else 1151 imcb_error(ic, "There are no active calls currently."); 1152 } 1158 nick = value; 1159 skype_call(ic, nick); 1160 } else 1161 skype_hangup(ic); 1153 1162 return value; 1154 1163 } … … 1314 1323 } 1315 1324 1325 #if BITLBEE_VERSION_CODE >= BITLBEE_VER(3, 0, 1) 1326 GList *skype_buddy_action_list( bee_user_t *bu ) 1327 { 1328 static GList *ret = NULL; 1329 1330 if (ret == NULL) 1331 { 1332 static const struct buddy_action ba[3] = { 1333 {"CALL", "Initiate a call" }, 1334 {"HANGUP", "Hang up a call" }, 1335 }; 1336 1337 ret = g_list_prepend(ret, (void*) ba + 0); 1338 } 1339 1340 return ret; 1341 } 1342 1343 void *skype_buddy_action( struct bee_user *bu, const char *action, char * const args[], void *data ) 1344 { 1345 if (!g_strcasecmp(action, "CALL")) { 1346 skype_call(bu->ic, bu->handle); 1347 } else if (!g_strcasecmp(action, "HANGUP")) { 1348 skype_hangup(bu->ic); 1349 } 1350 1351 return NULL; 1352 } 1353 #endif 1354 1316 1355 void init_plugin(void) 1317 1356 { … … 1335 1374 ret->handle_cmp = g_strcasecmp; 1336 1375 ret->chat_topic = skype_chat_topic; 1376 #if BITLBEE_VERSION_CODE >= BITLBEE_VER(3, 0, 1) 1377 ret->buddy_action_list = skype_buddy_action_list; 1378 ret->buddy_action = skype_buddy_action; 1379 #endif 1337 1380 register_protocol(ret); 1338 1381 }
Note: See TracChangeset
for help on using the changeset viewer.