| 138 | # This is the class for the server-side gRPC endpoints |
| 139 | class Plugin(pbx.PluginServicer): |
| 140 | def Account(self, acc_event, context): |
| 141 | action = None |
| 142 | if acc_event.action == pb.CREATE: |
| 143 | action = "created" |
| 144 | # TODO: subscribe to the new user. |
| 145 | |
| 146 | elif acc_event.action == pb.UPDATE: |
| 147 | action = "updated" |
| 148 | elif acc_event.action == pb.DELETE: |
| 149 | action = "deleted" |
| 150 | else: |
| 151 | action = "unknown" |
| 152 | |
| 153 | log("Account", action, ":", acc_event.user_id, acc_event.public) |
| 154 | |
| 155 | return pb.Unused() |
| 156 | |
| 157 | queue_out = queue.Queue() |
| 158 | |