aboutsummaryrefslogtreecommitdiffstats
path: root/skype/skype.c
diff options
context:
space:
mode:
authorVMiklos <vmiklos@frugalware.org>2007-10-06 18:05:44 +0200
committerVMiklos <vmiklos@frugalware.org>2007-10-06 18:05:44 +0200
commit2d0780303e487cbca12ac1443a951b77339068b5 (patch)
treef734e4aac7893848d4f69873e4486d721dc13ffd /skype/skype.c
parenta75f2a7a6f57da846ab54d6fe5d52ec0c021a042 (diff)
handle topic changes
Diffstat (limited to 'skype/skype.c')
-rw-r--r--skype/skype.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/skype/skype.c b/skype/skype.c
index e1fb7293..9658c796 100644
--- a/skype/skype.c
+++ b/skype/skype.c
@@ -69,6 +69,8 @@ struct skype_data
skype_call_status call_status;
/* Same for file transfers. */
skype_filetransfer_status filetransfer_status;
+ /* True if the next message will be a topic */
+ int topic;
};
struct skype_away_state
@@ -292,7 +294,13 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
if(sd->handle && strlen(info))
{
/* New body, we have everything to use imcb_buddy_msg() now! */
- imcb_buddy_msg(ic, sd->handle, info, 0, 0);
+ if(sd->topic)
+ {
+ imcb_log(ic, "%s has changed the chat topic to \"%s\"", sd->handle, info);
+ sd->topic = 0;
+ }
+ else
+ imcb_buddy_msg(ic, sd->handle, info, 0, 0);
}
}
}
@@ -373,6 +381,18 @@ static gboolean skype_read_callback( gpointer data, gint fd, b_input_condition c
}
}
}
+ else if(!strncmp(line, "CHAT ", 5))
+ {
+ char *id = strchr(line, ' ');
+ if(++id)
+ {
+ char *info = strchr(id, ' ');
+ *info = '\0';
+ info++;
+ if(!strncmp(info, "TOPIC ", 6))
+ sd->topic = 1;
+ }
+ }
lineptr++;
}
g_strfreev(lines);