Software / code / verse
Comparison
doc/example_jingle.lua @ 144:46e933d81024
docs/example_jingle.lua: Update to use content.type instead of content.name for checking the kind of content we're receiving
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 17 Sep 2010 16:42:50 +0100 |
| parent | 110:3fca7dd127df |
| child | 260:7f6df45a3d1f |
comparison
equal
deleted
inserted
replaced
| 143:641c0a1bb330 | 144:46e933d81024 |
|---|---|
| 38 c:hook("ready", function () | 38 c:hook("ready", function () |
| 39 print("Stream ready!"); | 39 print("Stream ready!"); |
| 40 | 40 |
| 41 -- Handle incoming Jingle requests | 41 -- Handle incoming Jingle requests |
| 42 c:hook("jingle", function (jingle) | 42 c:hook("jingle", function (jingle) |
| 43 if jingle.content.name == "file" then | 43 if jingle.content.type == "file" then |
| 44 print("File offer from "..jingle.peer.."!"); | 44 print("File offer from "..jingle.peer.."!"); |
| 45 print("Filename: "..jingle.content.file.name.." Size: "..jingle.content.file.size); | 45 print("Filename: "..jingle.content.file.name.." Size: "..jingle.content.file.size); |
| 46 jingle:accept({ save_file = jingle.content.file.name..".received" }); | 46 jingle:accept({ save_file = jingle.content.file.name..".received" }); |
| 47 end | 47 end |
| 48 end); | 48 end); |