diff options
| author | VMiklos <vmiklos@frugalware.org> | 2007-10-06 18:05:44 +0200 | 
|---|---|---|
| committer | VMiklos <vmiklos@frugalware.org> | 2007-10-06 18:05:44 +0200 | 
| commit | 2d0780303e487cbca12ac1443a951b77339068b5 (patch) | |
| tree | f734e4aac7893848d4f69873e4486d721dc13ffd | |
| parent | a75f2a7a6f57da846ab54d6fe5d52ec0c021a042 (diff) | |
handle topic changes
| -rw-r--r-- | skype/README | 4 | ||||
| -rw-r--r-- | skype/skype.c | 22 | 
2 files changed, 23 insertions, 3 deletions
diff --git a/skype/README b/skype/README index 9be00575..0457c3ea 100644 --- a/skype/README +++ b/skype/README @@ -183,6 +183,8 @@ your VNC server regularly. (How ugly.)  - Detect when somebody wants to transfer a file +- Handle topic changes +  == What needs to be done (aka. TODO)  - Group chat support. For an initial support the followings would be needed: @@ -191,8 +193,6 @@ your VNC server regularly. (How ugly.)    * Send / receive group chat messages. -  * Handle topic changes. -  - Add a question callback for calls.  == I would like to have support for ... 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);  | 
