本文整理汇总了C++中Skype::send_command方法的典型用法代码示例。如果您正苦于以下问题:C++ Skype::send_command方法的具体用法?C++ Skype::send_command怎么用?C++ Skype::send_command使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skype
的用法示例。
在下文中一共展示了Skype::send_command方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: skype_check_missedmessages
static gboolean skype_check_missedmessages(gpointer data) {
Skype *skype = (Skype *) data;
skype->send_command("SEARCH MISSEDCHATMESSAGES");
return TRUE;
}
示例2: handleMessageSendRequest
void handleMessageSendRequest(const std::string &user, const std::string &legacyName, const std::string &message, const std::string &xhtml) {
Skype *skype = m_sessions[user];
if (skype) {
skype->send_command("MESSAGE " + legacyName + " " + message);
}
}
示例3: handleVCardRequest
void handleVCardRequest(const std::string &user, const std::string &legacyName, unsigned int id) {
Skype *skype = m_sessions[user];
if (skype) {
std::string name = legacyName;
if (name.find("skype.") == 0) {
name = name.substr(6);
}
std::string photo;
gchar *filename = NULL;
gchar *new_filename = NULL;
gchar *image_data = NULL;
gsize image_data_len = 0;
gchar *ret;
int fh;
GError *error;
const gchar *userfiles[] = {"user256", "user1024", "user4096", "user16384", "user32768", "user65536",
"profile256", "profile1024", "profile4096", "profile16384", "profile32768",
NULL};
char *username = g_strdup_printf("\x03\x10%s", name.c_str());
for (fh = 0; userfiles[fh]; fh++) {
filename = g_strconcat("/tmp/skype/", skype->getUsername().c_str(), "/", skype->getUsername().c_str(), "/", userfiles[fh], ".dbb", NULL);
std::cout << "getting filename:" << filename << "\n";
if (g_file_get_contents(filename, &image_data, &image_data_len, NULL))
{
std::cout << "got\n";
char *start = (char *)memmem(image_data, image_data_len, username, strlen(username)+1);
if (start != NULL)
{
char *next = image_data;
char *last = next;
//find last index of l33l
while ((next = (char *)memmem(next+4, start-next-4, "l33l", 4)))
{
last = next;
}
start = last;
if (start != NULL)
{
char *img_start;
//find end of l33l block
char *end = (char *)memmem(start+4, image_data+image_data_len-start-4, "l33l", 4);
if (!end) end = image_data+image_data_len;
//look for start of JPEG block
img_start = (char *)memmem(start, end-start, "\xFF\xD8", 2);
if (img_start)
{
//look for end of JPEG block
char *img_end = (char *)memmem(img_start, end-img_start, "\xFF\xD9", 2);
if (img_end)
{
image_data_len = img_end - img_start + 2;
photo = std::string(img_start, image_data_len);
}
}
}
}
g_free(image_data);
}
g_free(filename);
}
g_free(username);
std::string alias = "";
std::cout << skype->getUsername() << " " << name << "\n";
if (skype->getUsername() == name) {
alias = skype->send_command("GET PROFILE FULLNAME");
alias = GET_RESPONSE_DATA(alias, "FULLNAME")
}
handleVCard(user, id, legacyName, "", alias, photo);
}
示例4: handleBuddyRemovedRequest
void handleBuddyRemovedRequest(const std::string &user, const std::string &buddyName, const std::vector<std::string> &groups) {
Skype *skype = m_sessions[user];
if (skype) {
skype->send_command("SET USER " + buddyName + " BUDDYSTATUS 1");
}
}